M220907031956InsterQimallCrontabTask.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\Seed\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220907031956InsterQimallCrontabTask
  6. */
  7. class M220907031956InsterQimallCrontabTask extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "";
  15. $sql .= "INSERT INTO `qimall_crontab_task`(`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('种子金能量池释放', 'seed/release-crontab/exec', 2, '0 0 */1 * * *', 0, 1, 1660554371, 1660554371);";
  16. $this->execute($sql);
  17. return true;
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M220907031956InsterQimallCrontabTask cannot be reverted.\n";
  25. return false;
  26. }
  27. /*
  28. // Use up()/down() to run migration code without a transaction.
  29. public function up()
  30. {
  31. }
  32. public function down()
  33. {
  34. echo "M220907031956InsterQimallCrontabTask cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }