M220915100927InsertQimallCrontab.php 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. *
  6. * Class M220915100927InsertQimallCrontab
  7. */
  8. class M220915100927InsertQimallCrontab extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql="INSERT INTO `qimall_crontab_task`( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ( '修改订单表流失单号', 'fix/out-order', 2, '0 */30 * * * *', 0, 1, 1663236777, 1663236777)";
  17. $this->execute($sql);
  18. }catch (\Exception $e){
  19. }
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M220915100927InsertQimallCrontab cannot be reverted.\n";
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M220915100927InsertQimallCrontab cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }