M230616023728AlterQimallAddonsStoreSettings.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230616023728AlterQimallAddonsStoreSettings
  6. */
  7. class M230616023728AlterQimallAddonsStoreSettings extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "ALTER table qimall_addons_store_settings add is_preferential_undertaking tinyint(1) not null DEFAULT 0 COMMENT '是否开启优惠谁承担独立设置,1:是;0:否';
  16. ALTER table qimall_addons_store_settings add preferential_undertaking tinyint(1) not null DEFAULT 1 COMMENT '优惠谁承担,1:平台;2:门店';";
  17. $this->execute($sql);
  18. } catch (\Exception $e) {
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M230616023728AlterQimallAddonsStoreSettings cannot be reverted.\n";
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M230616023728AlterQimallAddonsStoreSettings cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }