| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230517160536InsertQimallTask
- */
- class M230517160536InsertQimallTask extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql="INSERT INTO `qimall_crontab_task`(`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('定时清理冗余的定时任务记录', 'clear-crontab/execute', 2, '0 0 1 * * * *', 0, 1, 1638599725, 1660124907);";
- $this->execute($sql);
- }catch (\Exception $e){
- \Yii::error('M230517160536InsertQimallTask文件迁移执行失败');
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230517160536InsertQimallTask cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230517160536InsertQimallTask cannot be reverted.\n";
- return false;
- }
- */
- }
|