| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- use yii\db\Migration;
- class m220227_143429_member_level_config extends Migration
- {
- public function up()
- {
- /* 取消外键约束 */
- $this->execute('SET foreign_key_checks = 0');
- /* 创建表 */
- $this->createTable('{{%member_level_config}}', [
- 'id' => "int(11) NOT NULL AUTO_INCREMENT",
- 'merchant_id' => "int(11) unsigned NULL DEFAULT '0' COMMENT '商户id'",
- 'store_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '店铺ID'",
- 'upgrade_type' => "tinyint(4) NULL DEFAULT '1' COMMENT '升级方式'",
- 'auto_upgrade_type' => "tinyint(4) NULL DEFAULT '1' COMMENT '自动升级类型'",
- 'status' => "int(11) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]'",
- 'created_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '创建时间'",
- 'updated_at' => "int(10) unsigned NULL DEFAULT '0' COMMENT '修改时间'",
- 'PRIMARY KEY (`id`)'
- ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员_等级配置'");
- /* 索引设置 */
- /* 表数据 */
- /* 设置外键约束 */
- $this->execute('SET foreign_key_checks = 1;');
- }
- public function down()
- {
- $this->execute('SET foreign_key_checks = 0');
- /* 删除表 */
- $this->dropTable('{{%member_level_config}}');
- $this->execute('SET foreign_key_checks = 1;');
- }
- }
|