M250219061448InsertQimallCrontabTask.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250219061448InsertQimallCrontabTask
  6. */
  7. class M250219061448InsertQimallCrontabTask extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql ="
  15. INSERT `qimall_crontab_task` ( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('清除小时交易额缓存', 'census/clear-single-hour', 2, '0 0 */1 * * *', 0, 1, 1739932378, 1739945579);
  16. INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ( '清除单日数据缓存', 'census/clear-single-date', 2, '0 10 0 * * *', 0, 1, 1739932422, 1739945636);
  17. ";
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M250219061448InsertQimallCrontabTask cannot be reverted.\n";
  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 "M250219061448InsertQimallCrontabTask cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }