M250513093951InsertFreezeFundMonthlyLimitedCrontab.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace addons\DoubleCopy\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250513093951InsertFreezeFundMonthlyLimitedCrontab
  6. */
  7. class M250513093951InsertFreezeFundMonthlyLimitedCrontab extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $now = time();
  15. $sql = <<<SQL
  16. INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('二二复制执行冻结基金每月期限', 'double-copy/frozen-fund/freeze-fund-monthly-limited', 2, '0 0 0 1 * *', 0, 1, $now, $now);
  17. SQL;
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  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 "M250513093951InsertFreezeFundMonthlyLimitedCrontab cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }