| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230620061256AlterQimallAdmin
- */
- class M230620061256AlterQimallAdmin extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql="
- ALTER table qimall_admin add source tinyint(1) not null default 0 comment '来源类型:0:默认;1:注册';
- ALTER table qimall_admin add view_times int(11) not null default 0 comment '商城浏览时长';
- ALTER table qimall_admin add addons_view_times int(11) not null default 0 comment '应用浏览时长';
- ALTER TABLE qimall_admin MODIFY COLUMN expired_at BIGINT(20) NOT NULL default 0;
- ALTER TABLE qimall_mall MODIFY COLUMN expired_at BIGINT(20) NOT NULL default 0;
- ";
- $this->execute($sql);
- }catch (\Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230620061256AlterQimallAdmin cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230620061256AlterQimallAdmin cannot be reverted.\n";
- return false;
- }
- */
- }
|