M241011022302AddColumnToAgentDelayLog.php 901 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241011022302AddColumnToAgentDelayLog
  6. */
  7. class M241011022302AddColumnToAgentDelayLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_agent_delay_log`
  16. ADD COLUMN `source_table` varchar(100) NOT NULL DEFAULT '' COMMENT '来源表',
  17. ADD COLUMN `source_table_id` int UNSIGNED NULL DEFAULT 0 COMMENT '来源表的id';
  18. SQL;
  19. $this->execute($sql);
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. return false;
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "M241011022302AddColumnToAgentDelayLog cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }