M240403161820AlterQimallMall.php 922 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240403161820AlterQimallMall
  6. */
  7. class M240403161820AlterQimallMall extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "ALTER TABLE `qimall_mall`
  16. ADD COLUMN `is_compliance` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否合规模式:1是;0否';";
  17. $this->execute($sql);
  18. } catch (\Exception $e) {
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M240403161820AlterQimallMall 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 "M240403161820AlterQimallMall cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }