Skip to content

Commit 8bf3cbf

Browse files
author
igor-chepurnoi
committed
rename settings table to lowercase
1 parent 1dcf012 commit 8bf3cbf

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_104201_rename_setting_table extends Migration
6+
{
7+
public function up()
8+
{
9+
$this->renameTable('{{%Setting}}', '{{%setting}}');
10+
}
11+
12+
public function down()
13+
{
14+
$this->renameTable('{{%setting}}', '{{%Setting}}');
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/SettingModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SettingModel extends ActiveRecord
2929
*/
3030
public static function tableName()
3131
{
32-
return '{{%Setting}}';
32+
return '{{%setting}}';
3333
}
3434

3535
/**

tests/TestCase.php

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

8484
// Structure :
8585

86-
$db->createCommand()->createTable('Setting', [
86+
$db->createCommand()->createTable('setting', [
8787
'id' => 'pk',
8888
'type' => 'string(10) not null',
8989
'section' => 'string not null',

0 commit comments

Comments
 (0)