| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M241120090450InsertAddonsStoreAddons
- */
- class M241121141030InsertAddonsStoreMenu extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $time = time();
- $sql = <<<SQL
- INSERT INTO `qimall_addons_store_menu` (`title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('门店会员', '0', 0, 'StoreAssociatedUser', 1, 'store/store-associated-user/index/index', '', 2, 0, 999, NULL, '', 1, {$time}, {$time});
- SQL;
- $this->execute($sql);
- $id = $this->db->getLastInsertID($sql);
- $sql2 = <<<SQL
- INSERT INTO `qimall_addons_store_menu` (`title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('门店会员', '0', {$id}, 'StoreAssociatedUser', 1, 'store/store-associated-user/index/index', '', 2, 0, 999, NULL, '', 1, {$time}, {$time});
- SQL;
- $this->execute($sql2);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M241120090450InsertAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M241120090450InsertAddonsStoreMenu cannot be reverted.\n";
- return false;
- }
- */
- }
|