| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250121175530AddStoreCommonSyncLogs
- */
- class M250121175530AddStoreCommonSyncLogs extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_addons_store_common_sync_logs` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城ID',
- `type` varchar(255) NOT NULL DEFAULT '' COMMENT '类型',
- `self_store_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身门店ID',
- `source_store_id` int(11) NOT NULL DEFAULT '0' COMMENT '源门店ID',
- `type_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身门店的类型id',
- `source_type_id` int(11) NOT NULL DEFAULT '0' COMMENT '源门店的的类型id',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `idx_index` (`type`,`self_store_id`,`source_store_id`,`source_type_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='门店同步日志表';
- CREATE TABLE `qimall_addons_store_sync_goods_logs` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城ID',
- `self_store_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身门店ID',
- `source_store_id` int(11) NOT NULL DEFAULT '0' COMMENT '源门店ID',
- `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身门店的商品id',
- `source_goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '源门店的商品id',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='门店商品同步日志表';
- ALTER TABLE `qimall_addons_store` ADD COLUMN `is_sync` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否需要同步:0:否,1:是',
- ADD COLUMN `sync_status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '同步状态:0:待同步;1:同步中;2:同步完成';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250121175530AddStoreCommonSyncLogs cannot be reverted.\n";
- return false;
- }
-
- }
|