| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M250726022813InsertQimallGlobalVarMap
- */
- class M250726022813InsertQimallGlobalVarMap extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- return true;
- try {
- $sql = <<<SQL
- INSERT INTO `qimall_global_var_map`(`id`, `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES (NULL, 'luck_draw', '抽奖活动', 'CapitalTypeMap', 1, 1, 1673433032, 1673433032);
- INSERT INTO `qimall_global_var_map`(`id`, `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES (NULL, 'LuckDraw', '抽奖活动', 'FromTypeMap', 1, 1, 1673433032, 1673433032);
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- // 处理异常
- var_dump($e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250726022813InsertQimallGlobalVarMap cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250726022813InsertQimallGlobalVarMap cannot be reverted.\n";
- return false;
- }
- */
- }
|