| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace addons\CloudStock\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230717100209QimallAddonsCloudStockBonusPoolLogDetail
- */
- class M230717100209QimallAddonsCloudStockBonusPoolLogDetail extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $table = 'qimall_addons_cloud_stock_bonus_pool_log_detail';
- $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_bonus_pool_log_detail` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL COMMENT '商城ID',
- `pool_log_id` int(11) NOT NULL COMMENT 'pool_log_id',
- `user_id` int(11) NOT NULL COMMENT 'user_id',
- `level` int(11) NOT NULL DEFAULT '0' COMMENT '分红时等级',
- `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '当前分红池金额',
- `is_settled` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否结算:0:否;1:是',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` bigint(20) DEFAULT NULL,
- `updated_at` bigint(20) DEFAULT NULL,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='云库存分红池记录详情';";
- $this->execute($sql);
- }catch (\Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230717100209QimallAddonsCloudStockBonusPoolLogDetail cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230717100209QimallAddonsCloudStockBonusPoolLogDetail cannot be reverted.\n";
- return false;
- }
- */
- }
|