Skip to content

Commit b20ae21

Browse files
author
igor-chepurnoi
committed
rename table from 'CronSchedule' to 'cron_schedule'
1 parent 838897d commit b20ae21

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
use app\components\Migration;
4+
5+
class m161109_111305_rename_cron_schedule_table extends Migration
6+
{
7+
public function up()
8+
{
9+
$this->renameTable('{{%CronSchedule}}', '{{%cron_schedule}}');
10+
}
11+
12+
public function down()
13+
{
14+
$this->renameTable('{{%cron_schedule}}', '{{%CronSchedule}}');
15+
}
16+
17+
/*
18+
// Use safeUp/safeDown to run migration code within a transaction
19+
public function safeUp()
20+
{
21+
}
22+
23+
public function safeDown()
24+
{
25+
}
26+
*/
27+
}

models/CronScheduleModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CronScheduleModel extends ActiveRecord
2323
*/
2424
public static function tableName()
2525
{
26-
return '{{%CronSchedule}}';
26+
return '{{%cron_schedule}}';
2727
}
2828

2929
/**

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function setupTestDbData()
7979

8080
// Structure :
8181

82-
$db->createCommand()->createTable('{{%CronSchedule}}', [
82+
$db->createCommand()->createTable('{{%cron_schedule}}', [
8383
'id' => 'pk',
8484
'jobCode' => 'string not null',
8585
'status' => 'smallint not null',

0 commit comments

Comments
 (0)