| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240712141230AddTableUserTeamAchievementTable
- */
- class M240712141230AddTableUserTeamAchievementTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = <<<SQL
- CREATE TABLE `qimall_user_team_achievement_order_1` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_2` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_3` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_4` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
-
- CREATE TABLE `qimall_user_team_achievement_order_5` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_6` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_7` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_8` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_9` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- CREATE TABLE `qimall_user_team_achievement_order_10` (
- `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `user_id` int(10) NOT NULL COMMENT '下单会员ID',
- `order_id` int(10) NOT NULL COMMENT '订单ID',
- `superior_user_id` int(10) NOT NULL COMMENT '团队上级会员ID',
- `superior_level` int(10) NOT NULL COMMENT '上级级别',
- `status` tinyint(1) NOT NULL COMMENT '1 已支付 2 已完成',
- `created_at` int(10) NULL,
- PRIMARY KEY (`id`),
- INDEX `idx_mall_id`(`mall_id`),
- INDEX `idx_superior_user_id`(`superior_user_id`),
- INDEX `idx_order_id`(`order_id`)
- ) ENGINE = InnoDB COMMENT = '团队业绩订单表';
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240712141230AddTableUserTeamAchievementTable cannot be reverted.\n";
- return false;
- }
- }
|