| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240929021221QimallAddonsStoreReserveSetting
- */
- class M240929021221QimallAddonsStoreReserveSetting extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $table = 'qimall_addons_store_reserve_setting';
- $sql="select * from information_schema.TABLES where TABLE_NAME = '{$table}';";
- $res = $this->db->createCommand($sql)->execute();
- if(!empty($res)) return '';
- $sql="CREATE TABLE `qimall_addons_store_reserve_setting` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `mall_id` int(10) unsigned NOT NULL COMMENT '商城ID',
- `store_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
- `setting` text COMMENT '',
- `status` tinyint(3) NOT NULL DEFAULT '1' COMMENT '状态0禁用,-1删除,1正常',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `store_id` (`store_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='预约门店独立设置';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240929021221QimallAddonsStoreReserveSetting cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240929021221QimallAddonsStoreReserveSetting cannot be reverted.\n";
- return false;
- }
- */
- }
|