@@ 213-230 (lines=18) @@ | ||
210 | $options = $table->getOptions(); |
|
211 | ||
212 | // Add the default primary key |
|
213 | if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { |
|
214 | $column = new Column(); |
|
215 | $column->setName('id') |
|
216 | ->setType('integer') |
|
217 | ->setIdentity(true); |
|
218 | ||
219 | array_unshift($columns, $column); |
|
220 | $options['primary_key'] = 'id'; |
|
221 | } elseif (isset($options['id']) && is_string($options['id'])) { |
|
222 | // Handle id => "field_name" to support AUTO_INCREMENT |
|
223 | $column = new Column(); |
|
224 | $column->setName($options['id']) |
|
225 | ->setType('integer') |
|
226 | ->setIdentity(true); |
|
227 | ||
228 | array_unshift($columns, $column); |
|
229 | $options['primary_key'] = $options['id']; |
|
230 | } |
|
231 | ||
232 | $sql = 'CREATE TABLE '; |
|
233 | $sql .= $this->quoteTableName($table->getName()) . ' ('; |
@@ 190-207 (lines=18) @@ | ||
187 | $options = $table->getOptions(); |
|
188 | ||
189 | // Add the default primary key |
|
190 | if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) { |
|
191 | $column = new Column(); |
|
192 | $column->setName('id') |
|
193 | ->setType('integer') |
|
194 | ->setIdentity(true); |
|
195 | ||
196 | array_unshift($columns, $column); |
|
197 | $options['primary_key'] = 'id'; |
|
198 | } elseif (isset($options['id']) && is_string($options['id'])) { |
|
199 | // Handle id => "field_name" to support AUTO_INCREMENT |
|
200 | $column = new Column(); |
|
201 | $column->setName($options['id']) |
|
202 | ->setType('integer') |
|
203 | ->setIdentity(true); |
|
204 | ||
205 | array_unshift($columns, $column); |
|
206 | $options['primary_key'] = $options['id']; |
|
207 | } |
|
208 | ||
209 | // TODO - process table options like collation etc |
|
210 | $sql = 'CREATE TABLE '; |