| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace addons\Boss\console\migrations;
- use yii\db\Migration;
- /**
- * Class M220914072538CreateQimallAddonsBossGoodsStatistics
- */
- class M220914072538CreateQimallAddonsBossGoodsStatistics extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_boss_goods_statistics` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL DEFAULT '0' COMMENT '商城ID',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
- `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品ID',
- `buy_num` int(10) NOT NULL DEFAULT '0' COMMENT '购买数量',
- `money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额',
- `date` int(10) NOT NULL DEFAULT '0' 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 `idx_user_goods_date` (`user_id`,`goods_id`,`date`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户购买商品统计';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M220914072538QimallAddonsBossGoodsStatistics cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M220914072538QimallAddonsBossGoodsStatistics cannot be reverted.\n";
- return false;
- }
- */
- }
|