| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M241007063457QimallAddonsStoreReserveTechnicianSchedulingTime
- */
- class M241007063457QimallAddonsStoreReserveTechnicianSchedulingTime extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $table = 'qimall_addons_store_reserve_technician_scheduling_time';
- $sql = "select * from information_schema.TABLES where TABLE_NAME = '{$table}';";
- $res = $this->db->createCommand($sql)->execute();
- if (empty($res)) {
- $sql = "
- CREATE TABLE `qimall_addons_store_reserve_technician_scheduling_time` (
- `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',
- `sid` int(11) DEFAULT NULL COMMENT '排期id',
- `start_time` int(11) DEFAULT NULL COMMENT '开始时间',
- `end_time` int(11) DEFAULT NULL COMMENT '结束时间',
- `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 "M241007063457QimallAddonsStoreReserveTechnicianSchedulingTime cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M241007063457QimallAddonsStoreReserveTechnicianSchedulingTime cannot be reverted.\n";
- return false;
- }
- */
- }
|