| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240521070855BodyFatScaleAddColumn
- */
- class M240521070855BodyFatScaleAddColumn extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->execute("ALTER TABLE `qimall_user_extra`
- ADD COLUMN `target_weight` DECIMAL(5,2) NOT NULL DEFAULT 0 COMMENT '目标体重',
- ADD COLUMN `body_weight` DECIMAL(5,2) NOT NULL DEFAULT '0.00' COMMENT '体重' AFTER `target_weight`,
- ADD COLUMN `body_height` DECIMAL(5,2) NOT NULL DEFAULT '0.00' COMMENT '身高' AFTER `body_weight`;");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240521070855BodyFatScaleAddColumn cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240521070855BodyFatScaleAddColumn cannot be reverted.\n";
- return false;
- }
- */
- }
|