| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace addons\CloudStock\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230627012405QimallAddonsCloudStockPushDelayLog
- */
- class M230627012405QimallAddonsCloudStockPushDelayLog extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $table = 'qimall_addons_cloud_stock_push_delay_log';
- $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_cloud_stock_push_delay_log` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城id',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
- `agent_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
- `stock_log_id` int(11) NOT NULL DEFAULT '0' COMMENT 'stock_log_id',
- `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT 'order_id',
- `not_yet_num` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
- `order_type` varchar(255) NOT NULL COMMENT '订单类型',
- `time_limit_fill_user_ids` text,
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` bigint(20) NOT NULL DEFAULT '0',
- `updated_at` bigint(20) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='云库存投递延时队列记录表';";
- $this->execute($sql);
- }catch (\Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230627012405QimallAddonsCloudStockPushDelayLog cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230627012405QimallAddonsCloudStockPushDelayLog cannot be reverted.\n";
- return false;
- }
- */
- }
|