| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230109084131AddMemberPriceSwitchToGoodsExtra
- */
- class M230109084131AddMemberPriceSwitchToGoodsExtra extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $this->addColumn('{{%goods_extra}}', 'member_price_switch', $this->tinyInteger(4)->defaultValue(0)->comment('是否单独设置会员价'));
- }catch (\Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- $this->dropColumn('{{%goods_extra}}', 'member_price_switch');
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230109084131AddMemberPriceSwitchToGoodsExtra cannot be reverted.\n";
- return false;
- }
- */
- }
|