| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace addons\DoubleCopy\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230602151236QimallAddonsDoubleCopyChangePos
- */
- class M230602151236QimallAddonsDoubleCopyChangePos extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_double_copy_change_pos` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL DEFAULT '0' COMMENT '商城ID',
- `content` text COLLATE utf8mb4_unicode_ci COMMENT '交换内容',
- `change_status` tinyint(2) DEFAULT '0' COMMENT '交换状态[-1=交换失败,0=交换中,1=交换成功]',
- `reason` text COLLATE utf8mb4_unicode_ci COMMENT '失败原因',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) DEFAULT '0' COMMENT '更新时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `mall_id` (`mall_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='位置交换表';";
- $sql.= "CREATE TABLE `qimall_addons_double_copy_change_topid` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `change_pos_id` int(10) NOT NULL DEFAULT '0' COMMENT 'qimall_addons_double_copy_change_pos.id',
- `mall_id` int(10) NOT NULL DEFAULT '0' COMMENT '商城ID',
- `user_id` int(10) DEFAULT '0' COMMENT '用户ID',
- `old_topid` int(10) DEFAULT '0' COMMENT '原topid',
- `now_topid` int(10) DEFAULT '0' COMMENT '现topid',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) DEFAULT '0' COMMENT '更新时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `mall_id` (`mall_id`) USING BTREE,
- KEY `change_pos_id` (`change_pos_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='位置交换平台补贴用户变动表';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230602151236QimallAddonsDoubleCopyChangePos cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230602151236QimallAddonsDoubleCopyChangePos cannot be reverted.\n";
- return false;
- }
- */
- }
|