M240718112745CreateBonusRestrictBossLevelSetting.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace addons\Boss\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * 股东分佣设置表 添加股东分红限制字段
  6. * Class M240718112745CreateBonusRestrictBossLevelSetting
  7. */
  8. class M240718112745CreateBonusRestrictBossLevelSetting extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $sql = <<<SQL
  16. ALTER TABLE `qimall_addons_boss_level_setting`
  17. ADD COLUMN `bonus_restrict` tinyint(1) COMMENT '股东分红限制[0=关闭, 1=开启]' AFTER `extra_restrict_values`,
  18. ADD COLUMN `bonus_restrict_keys` varchar(255) COMMENT '股东分红限制条件key合集' AFTER `bonus_restrict`,
  19. ADD COLUMN `bonus_restrict_values` text COMMENT '股东分红限制条件值合集' AFTER `bonus_restrict_keys`;
  20. SQL;
  21. $this->execute($sql);
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M240718112745CreateBonusRestrictBossLevelSetting cannot be reverted.\n";
  29. return false;
  30. }
  31. /*
  32. // Use up()/down() to run migration code without a transaction.
  33. public function up()
  34. {
  35. }
  36. public function down()
  37. {
  38. echo "M240718112745CreateBonusRestrictBossLevelSetting cannot be reverted.\n";
  39. return false;
  40. }
  41. */
  42. }