| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M250726022437InsertQimallDiyComponents
- */
- class M250726022437InsertQimallDiyComponents extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- return true;
- try {
- $sql = <<<SQL
- INSERT INTO `qimall_diy_components`(`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ('luck-draw', '抽奖活动', 'marketing', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'LuckDraw', 1, 1634538238, 1634538238);
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- // 处理异常
- var_dump($e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250726022437InsertQimallDiyComponents cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250726022437InsertQimallDiyComponents cannot be reverted.\n";
- return false;
- }
- */
- }
|