| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- class M250610104039InsertGlobalVarMap extends Migration
- {
- /**
- * 在qimall_global_var_map这个枚举表中,增加一条记录
- */
- public function safeUp()
- {
- try {
- $sql = <<<SQL
- INSERT INTO `qimall_global_var_map` (`name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ('score_expansion_transfer', '积分转入', 'CapitalTypeMap', 0, 1, 1750836015, 1750836015);
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- // 处理异常
- var_dump($e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250610104039InsertGlobalVarMap cannot be reverted.\n";
- return false;
- }
- }
|