| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240726015927ReserveOrderAddAttrId
- */
- class M240726015927ReserveOrderAddAttrId extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- if (!\Yii::$app->db->schema->getTableSchema('qimall_order_reserve', true)->getColumn('attr_id')) {
- $this->execute("ALTER TABLE `qimall_order_reserve`
- ADD COLUMN `attr_id` INT(11) NOT NULL DEFAULT '0';");
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240726015927ReserveOrderAddAttrId cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240726015927ReserveOrderAddAttrId cannot be reverted.\n";
- return false;
- }
- */
- }
|