M250710034630AddColumnsToGoodsExtraTable.php 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250710034630AddColumnsToGoodsExtraTable
  6. */
  7. class M250710034630AddColumnsToGoodsExtraTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_goods_extra`
  16. ADD COLUMN `symptom_list` longtext NULL COMMENT '疾病列表,药品商品类型使用',
  17. ADD COLUMN `description_template_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品说明模板id',
  18. ADD COLUMN `description_list` longtext NULL COMMENT '商品说明列表';
  19. SQL;
  20. $this->execute($sql);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  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 "M250710034630AddColumnsToGoodsExtraTable cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }