| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250726084649InsertQimallLinkCategory
- */
- class M250819104649InsertQimallLinkCategory extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "select * from qimall_link_category where name = 'store_steward' and pid = 0";
- $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 ('store-commodity-cate', 'O2O商品分类', ".$list[0]['id'].", 1, NULL, 1, 1755571380, 1755571380);";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250726084649InsertQimallLinkCategory cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250726084649InsertQimallLinkCategory cannot be reverted.\n";
- return false;
- }
- */
- }
|