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