M240326104109AddCloseActiveCrontab.php 733 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace addons\Bargain\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240326104109AddCloseActiveCrontab
  6. */
  7. class M240326104109AddCloseActiveCrontab extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql="INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('砍价关闭活动检查', 'bargain/bargain/close-active', 2, '0 */1 * * * *', 0, 1, 1702697681, 1702697681);";
  15. $this->execute($sql);
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function safeDown()
  21. {
  22. echo "M240326104109AddCloseActiveCrontab cannot be reverted.\n";
  23. return false;
  24. }
  25. }