M230227023408AddTaskToCrontabTask.php 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230227023408AddTaskToCrontabTask
  6. */
  7. class M230227023408AddTaskToCrontabTask 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 ( '修复会员订单统计数据', 'auto-test/fix-order-unread', '2', '0 15 0 * * *', '0', '1', '1677465502', '1677465502' );";
  15. $this->execute($sql);
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function safeDown()
  21. {
  22. echo "M230227023408AddTaskToCrontabTask cannot be reverted.\n";
  23. return false;
  24. }
  25. /*
  26. // Use up()/down() to run migration code without a transaction.
  27. public function up()
  28. {
  29. }
  30. public function down()
  31. {
  32. echo "M230227023408AddTaskToCrontabTask cannot be reverted.\n";
  33. return false;
  34. }
  35. */
  36. }