| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace addons\UpgradeGift\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240809015734UpgradeGiftStatisticsAddGoodsColumn
- */
- class M240809015734UpgradeGiftStatisticsAddGoodsColumn extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- ALTER TABLE `qimall_addons_upgrade_gift_statistics`
- ADD COLUMN `goods_num` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '应发商品',
- ADD COLUMN `actual_goods_num` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '实发商品';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240809015734UpgradeGiftStatisticsAddGoodsColumn cannot be reverted.\n";
- return false;
- }
- */
- }
|