| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- *
- * Class M221214081051AddRecordToDiyComponents
- */
- class M221214081051AddRecordToDiyComponents extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "select * from qimall_diy_components where code = 'micro-theme'";
- $res = $this->db->createCommand($sql)->execute();
- if($res) return '';
- $sql = 'INSERT INTO `qimall_diy_components` ( `code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ( \'micro-theme\', \'轮播组件\', \'img_text\', \'\', \'1\', \'0\', \'{\"is_drag\":\"false\",\"is_up\":\"false\",\"id_down\":\"false\",\"is_copy\":\"false\"}\', \'999\', \'\', \'1\', \'1634538238\', \'1634538238\');';
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M221214081051AddRecordToDiyComponents cannot be reverted.\n";
- return false;
- }
- }
|