| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240716032704AlterQimallAppVersion
- */
- class M240716032704AlterQimallAppVersion extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- //创建app版本表
- $sql = "CREATE TABLE `qimall_app_version` (
- `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `mall_id` int(10) DEFAULT '0' COMMENT '商城ID',
- `app_type` enum('android','ios') DEFAULT 'android' COMMENT 'APP应用类型',
- `content` text COMMENT '更新内容',
- `version` varchar(255) DEFAULT '' COMMENT '版本号',
- `version_num` int(10) DEFAULT '0' COMMENT '版本号数字',
- `download_url` varchar(500) DEFAULT '' COMMENT '安装包下载链接',
- `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) unsigned DEFAULT '0' COMMENT '修改时间',
- `edition_force` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否强制更新 0代表否 1代表是',
- `package_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0是整包升级 1是wgt升级',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `mall_id+version_num` (`mall_id`,`version_num`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='APP版本表';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240716032704AlterQimallAppVersion cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240716032704AlterQimallAppVersion cannot be reverted.\n";
- return false;
- }
- */
- }
|