| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Handles the creation of table `{{%user_level_upgrade_log}}`.
- */
- class M240815104616CreateUserLevelUpgradeLogTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_user_level_upgrade_log` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',
- `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
- `before_level` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户修改前等级',
- `after_level` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户修改后等级',
- `upgrade_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '-3手动降级,-2售后降级,1条件升级,2购买指定商品升级,3手动升级',
- `admin_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作人ID',
- `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID',
- `upgrade_condition` json DEFAULT NULL COMMENT '条件升级内容',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `user_id` (`user_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户升级记录';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- }
|