| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M241007063133QimallAddonsStoreReserveTechnicianScheduling
- */
- class M241007063133QimallAddonsStoreReserveTechnicianScheduling extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $table = 'qimall_addons_store_reserve_technician_scheduling';
- $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_technician_scheduling` (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
- `mall_id` int(11) NOT NULL COMMENT '商城id',
- `store_id` int(11) NOT NULL COMMENT '门店id',
- `user_id` int(11) DEFAULT NULL COMMENT 'user_id',
- `date_time` int(11) DEFAULT NULL COMMENT '日期',
- `is_all_day` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否全天(0:不是,1:是)',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(-1:删除,0:禁用,1:启用)',
- `created_at` bigint(20) DEFAULT NULL COMMENT '创建时间',
- `updated_at` bigint(20) DEFAULT NULL COMMENT '修改时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- ";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M241007063133QimallAddonsStoreReserveTechnicianScheduling cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M241007063133QimallAddonsStoreReserveTechnicianScheduling cannot be reverted.\n";
- return false;
- }
- */
- }
|