Completed
Push — master ( 4d7f6a...4b6420 )
by Igor
02:31
created
migrations/m130524_201442_init.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
         //Create user table
24 24
         $this->createTable('{{%User}}', [
25 25
             'id' => Schema::TYPE_PK,
26
-            'username' => Schema::TYPE_STRING . ' NOT NULL',
27
-            'authKey' => Schema::TYPE_STRING . '(32) NOT NULL',
28
-            'passwordHash' => Schema::TYPE_STRING . ' NOT NULL',
26
+            'username' => Schema::TYPE_STRING.' NOT NULL',
27
+            'authKey' => Schema::TYPE_STRING.'(32) NOT NULL',
28
+            'passwordHash' => Schema::TYPE_STRING.' NOT NULL',
29 29
             'passwordResetToken' => Schema::TYPE_STRING,
30
-            'email' => Schema::TYPE_STRING . ' NOT NULL',
31
-            'status' => Schema::TYPE_SMALLINT . ' NOT NULL DEFAULT 10',
32
-            'createdAt' => Schema::TYPE_INTEGER . ' NOT NULL',
33
-            'updatedAt' => Schema::TYPE_INTEGER . ' NOT NULL',
30
+            'email' => Schema::TYPE_STRING.' NOT NULL',
31
+            'status' => Schema::TYPE_SMALLINT.' NOT NULL DEFAULT 10',
32
+            'createdAt' => Schema::TYPE_INTEGER.' NOT NULL',
33
+            'updatedAt' => Schema::TYPE_INTEGER.' NOT NULL',
34 34
             'lastLogin' => Schema::TYPE_INTEGER,
35 35
         ], $tableOptions);
36 36
 
@@ -43,32 +43,32 @@  discard block
 block discarded – undo
43 43
         //Create Cms table
44 44
         $this->createTable('{{%Cms}}', [
45 45
             'id' => Schema::TYPE_PK,
46
-            'url' => Schema::TYPE_STRING . '(255)',
47
-            'title' => Schema::TYPE_STRING . '(255)',
46
+            'url' => Schema::TYPE_STRING.'(255)',
47
+            'title' => Schema::TYPE_STRING.'(255)',
48 48
             'content' => Schema::TYPE_TEXT,
49 49
             'status' => Schema::TYPE_SMALLINT,
50 50
             'commentAvailable' => 'TINYINT(1) DEFAULT 0',
51 51
             'metaTitle' => Schema::TYPE_TEXT,
52 52
             'metaDescription' => Schema::TYPE_TEXT,
53 53
             'metaKeywords' => Schema::TYPE_TEXT,
54
-            'createdAt' => Schema::TYPE_INTEGER . ' NOT NULL',
55
-            'updatedAt' => Schema::TYPE_INTEGER . ' NOT NULL',
54
+            'createdAt' => Schema::TYPE_INTEGER.' NOT NULL',
55
+            'updatedAt' => Schema::TYPE_INTEGER.' NOT NULL',
56 56
         ], $tableOptions);
57 57
 
58 58
         //Create Comment table
59 59
         $this->createTable('{{%Comment}}', [
60 60
             'id' => Schema::TYPE_PK,
61 61
             'entity' => 'CHAR(10) NOT NULL',
62
-            'entityId' => Schema::TYPE_INTEGER . ' NOT NULL',
63
-            'content' => Schema::TYPE_TEXT . ' NOT NULL',
64
-            'parentId' => Schema::TYPE_INTEGER . ' DEFAULT NULL',
62
+            'entityId' => Schema::TYPE_INTEGER.' NOT NULL',
63
+            'content' => Schema::TYPE_TEXT.' NOT NULL',
64
+            'parentId' => Schema::TYPE_INTEGER.' DEFAULT NULL',
65 65
             'level' => 'TINYINT(3) NOT NULL DEFAULT 1',
66
-            'createdBy' => Schema::TYPE_INTEGER . ' NOT NULL',
67
-            'updatedBy' => Schema::TYPE_INTEGER . ' NOT NULL',
66
+            'createdBy' => Schema::TYPE_INTEGER.' NOT NULL',
67
+            'updatedBy' => Schema::TYPE_INTEGER.' NOT NULL',
68 68
             'relatedTo' => $this->string(500)->notNull(),
69 69
             'status' => 'TINYINT(2) NOT NULL DEFAULT 1',
70
-            'createdAt' => Schema::TYPE_INTEGER . ' NOT NULL',
71
-            'updatedAt' => Schema::TYPE_INTEGER . ' NOT NULL',
70
+            'createdAt' => Schema::TYPE_INTEGER.' NOT NULL',
71
+            'updatedAt' => Schema::TYPE_INTEGER.' NOT NULL',
72 72
         ], $tableOptions);
73 73
 
74 74
         //Insert pages in CMS table
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 
87 87
         $this->createTable('{{%Setting}}', [
88 88
             'id' => Schema::TYPE_PK,
89
-            'type' => Schema::TYPE_STRING . '(10) NOT NULL',
90
-            'section' => Schema::TYPE_STRING . ' NOT NULL',
91
-            'key' => Schema::TYPE_STRING . ' NOT NULL',
92
-            'value' => Schema::TYPE_STRING . ' NOT NULL',
93
-            'status' => Schema::TYPE_SMALLINT . ' NOT NULL',
94
-            'createdAt' => Schema::TYPE_INTEGER . ' NOT NULL',
95
-            'updatedAt' => Schema::TYPE_INTEGER . ' NOT NULL',
89
+            'type' => Schema::TYPE_STRING.'(10) NOT NULL',
90
+            'section' => Schema::TYPE_STRING.' NOT NULL',
91
+            'key' => Schema::TYPE_STRING.' NOT NULL',
92
+            'value' => Schema::TYPE_STRING.' NOT NULL',
93
+            'status' => Schema::TYPE_SMALLINT.' NOT NULL',
94
+            'createdAt' => Schema::TYPE_INTEGER.' NOT NULL',
95
+            'updatedAt' => Schema::TYPE_INTEGER.' NOT NULL',
96 96
         ], $tableOptions
97 97
         );
98 98
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         ]);
129 129
 
130 130
         $this->createTable('{{%AuthRule}}', [
131
-            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
131
+            'name' => Schema::TYPE_STRING.'(64) NOT NULL',
132 132
             'data' => Schema::TYPE_TEXT,
133 133
             'created_at' => Schema::TYPE_INTEGER,
134 134
             'updated_at' => Schema::TYPE_INTEGER,
@@ -136,45 +136,45 @@  discard block
 block discarded – undo
136 136
         ], $tableOptions);
137 137
 
138 138
         $this->createTable('{{%AuthItem}}', [
139
-            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
140
-            'type' => Schema::TYPE_INTEGER . ' NOT NULL',
139
+            'name' => Schema::TYPE_STRING.'(64) NOT NULL',
140
+            'type' => Schema::TYPE_INTEGER.' NOT NULL',
141 141
             'description' => Schema::TYPE_TEXT,
142
-            'rule_name' => Schema::TYPE_STRING . '(64)',
142
+            'rule_name' => Schema::TYPE_STRING.'(64)',
143 143
             'data' => Schema::TYPE_TEXT,
144 144
             'created_at' => Schema::TYPE_INTEGER,
145 145
             'updated_at' => Schema::TYPE_INTEGER,
146 146
             'PRIMARY KEY (name)',
147
-            'FOREIGN KEY (rule_name) REFERENCES ' . '{{%AuthRule}}' . ' (name) ON DELETE SET NULL ON UPDATE CASCADE',
147
+            'FOREIGN KEY (rule_name) REFERENCES '.'{{%AuthRule}}'.' (name) ON DELETE SET NULL ON UPDATE CASCADE',
148 148
         ], $tableOptions);
149 149
 
150 150
         $this->createIndex('idx-auth_item-type', '{{%AuthItem}}', 'type');
151 151
 
152 152
         $this->createTable('{{%AuthItemChild}}', [
153
-            'parent' => Schema::TYPE_STRING . '(64) NOT NULL',
154
-            'child' => Schema::TYPE_STRING . '(64) NOT NULL',
153
+            'parent' => Schema::TYPE_STRING.'(64) NOT NULL',
154
+            'child' => Schema::TYPE_STRING.'(64) NOT NULL',
155 155
             'PRIMARY KEY (parent, child)',
156
-            'FOREIGN KEY (parent) REFERENCES ' . '{{%AuthItem}}' . ' (name) ON DELETE CASCADE ON UPDATE CASCADE',
157
-            'FOREIGN KEY (child) REFERENCES ' . '{{%AuthItem}}' . ' (name) ON DELETE CASCADE ON UPDATE CASCADE',
156
+            'FOREIGN KEY (parent) REFERENCES '.'{{%AuthItem}}'.' (name) ON DELETE CASCADE ON UPDATE CASCADE',
157
+            'FOREIGN KEY (child) REFERENCES '.'{{%AuthItem}}'.' (name) ON DELETE CASCADE ON UPDATE CASCADE',
158 158
         ], $tableOptions);
159 159
 
160 160
         $this->createTable('{{%AuthAssignment}}', [
161
-            'item_name' => Schema::TYPE_STRING . '(64) NOT NULL',
162
-            'user_id' => Schema::TYPE_INTEGER . ' NOT NULL',
161
+            'item_name' => Schema::TYPE_STRING.'(64) NOT NULL',
162
+            'user_id' => Schema::TYPE_INTEGER.' NOT NULL',
163 163
             'created_at' => Schema::TYPE_INTEGER,
164 164
             'PRIMARY KEY (item_name, user_id)',
165
-            'FOREIGN KEY (item_name) REFERENCES ' . '{{%AuthItem}}' . ' (name) ON DELETE CASCADE ON UPDATE CASCADE',
165
+            'FOREIGN KEY (item_name) REFERENCES '.'{{%AuthItem}}'.' (name) ON DELETE CASCADE ON UPDATE CASCADE',
166 166
         ], $tableOptions);
167 167
 
168 168
         // Create Cron Shedule table
169
-        $this->createTable('{{%CronSchedule}}',[
169
+        $this->createTable('{{%CronSchedule}}', [
170 170
             'id' => Schema::TYPE_PK,
171
-            'jobCode' => Schema::TYPE_STRING . '(255) NULL DEFAULT NULL',
172
-            'status' => Schema::TYPE_SMALLINT . ' NOT NULL',
173
-            'messages' => Schema::TYPE_TEXT . ' NULL',
174
-            'dateCreated' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
175
-            'dateScheduled' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
176
-            'dateExecuted' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
177
-            'dateFinished' => Schema::TYPE_TIMESTAMP . ' NULL DEFAULT NULL',
171
+            'jobCode' => Schema::TYPE_STRING.'(255) NULL DEFAULT NULL',
172
+            'status' => Schema::TYPE_SMALLINT.' NOT NULL',
173
+            'messages' => Schema::TYPE_TEXT.' NULL',
174
+            'dateCreated' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
175
+            'dateScheduled' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
176
+            'dateExecuted' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
177
+            'dateFinished' => Schema::TYPE_TIMESTAMP.' NULL DEFAULT NULL',
178 178
         ],
179 179
             $tableOptions
180 180
         );
Please login to merge, or discard this patch.