M250825182939InsertGlobalVarMap.php 836 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. class M250825182939InsertGlobalVarMap extends Migration
  5. {
  6. /**
  7. * 在qimall_global_var_map这个枚举表中,增加一条记录
  8. */
  9. public function safeUp()
  10. {
  11. try {
  12. $sql = <<<SQL
  13. INSERT INTO `qimall_global_var_map` (`name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ('withdrawal_follow_decr', '提现', 'CapitalTypeMap', 0, 1, 1756172727, 1756172727);
  14. SQL;
  15. $this->execute($sql);
  16. } catch (\Exception $e) {
  17. // 处理异常
  18. var_dump($e->getMessage());
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M250825182939InsertGlobalVarMap cannot be reverted.\n";
  27. return false;
  28. }
  29. }