| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M241231092053CreateUserOrderRelations
- */
- class M250307114941CreateCensusMallCapitalStatistics extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_census_mall_capital_statistics`
- (
- `id` INT AUTO_INCREMENT,
- `mall_id` INT UNSIGNED NOT NULL COMMENT '商城ID',
- `statistics_date` varchar(20) NOT NULL DEFAULT '' COMMENT '统计日期',
- `balance_surplus_nums` DECIMAL(14, 2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '余额剩余数量',
- `commission_surplus_nums` DECIMAL(14, 2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '佣金剩余数量',
- `score_surplus_nums` DECIMAL(14, 2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '积分剩余数量',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用;]',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id_statistics_date` (`mall_id`, `statistics_date`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='商城资金统计';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250307105400CreateCensusMallCapitalStatistics cannot be reverted.\n";
- return false;
- }
- */
- }
|