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