| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250702095957InsertQimallLinkCategory
- */
- class M250702095957InsertQimallLinkCategory extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "INSERT INTO `qimall_link_category` ( `name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES
- ( 'store_steward', '门店管家', 0, 0, NULL, 1, 1639814497, 1640312920);";
- $this->execute($sql);
- $sql = "select * from qimall_link_category where name = 'store_steward'";
- $list = \Yii::$app->db->createCommand($sql)->queryAll();
- if($list){
- $sql = "INSERT INTO `qimall_link_category` ( `name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES ('diy_template', '装修页面', ".$list[0]['id'].", 1, NULL, 1, 1639814136, 1639814255);";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250702095957InsertQimallLinkCategory cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250702095957InsertQimallLinkCategory cannot be reverted.\n";
- return false;
- }
- */
- }
|