| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230602020213AddFieldsToGoodsExtra
- */
- class M230602020213AddFieldsToGoodsExtra extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "ALTER TABLE `qimall_goods_extra`
- ADD COLUMN `is_repurchase` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否开启复购价[0=否, 1=是]',
- ADD COLUMN `repurchase_setting` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '复购价设置';";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230602020213AddFieldsToGoodsExtra cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230602020213AddFieldsToGoodsExtra cannot be reverted.\n";
- return false;
- }
- */
- }
|