File tree Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use app \components \Migration ;
4+
5+ class m161109_105445_rename_cms_table extends Migration
6+ {
7+ public function up ()
8+ {
9+ $ this ->renameTable ('{{%Cms}} ' , '{{%cms}} ' );
10+ }
11+
12+ public function down ()
13+ {
14+ $ this ->renameTable ('{{%cms}} ' , '{{%Cms}} ' );
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+ }
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class CmsModel extends ActiveRecord
2929 */
3030 public static function tableName ()
3131 {
32- return '{{%Cms }} ' ;
32+ return '{{%cms }} ' ;
3333 }
3434
3535 /**
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ protected function setupTestDbData()
9898
9999 // Structure :
100100
101- $ db ->createCommand ()->createTable ('Cms ' , [
101+ $ db ->createCommand ()->createTable ('cms ' , [
102102 'id ' => 'pk ' ,
103103 'url ' => 'string not null ' ,
104104 'title ' => 'string not null ' ,
@@ -114,7 +114,7 @@ protected function setupTestDbData()
114114
115115 // Data :
116116
117- $ db ->createCommand ()->insert ('Cms ' , [
117+ $ db ->createCommand ()->insert ('cms ' , [
118118 'url ' => 'about-us ' ,
119119 'title ' => 'about ' ,
120120 'content ' => 'test content ' ,
@@ -125,7 +125,7 @@ protected function setupTestDbData()
125125 'updatedAt ' => time (),
126126 ])->execute ();
127127
128- $ db ->createCommand ()->insert ('Cms ' , [
128+ $ db ->createCommand ()->insert ('cms ' , [
129129 'url ' => 'some-url ' ,
130130 'title ' => 'some title ' ,
131131 'content ' => 'My site name is {siteName} ' ,
You can’t perform that action at this time.
0 commit comments