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