src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location
|
@@ 223-232 (lines=10) @@
|
| 220 |
|
$options['id'] = 'id'; |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
if (isset($options['id']) && is_string($options['id'])) { |
| 224 |
|
// Handle id => "field_name" to support AUTO_INCREMENT |
| 225 |
|
$column = new Column(); |
| 226 |
|
$column->setName($options['id']) |
| 227 |
|
->setType('integer') |
| 228 |
|
->setIdentity(true); |
| 229 |
|
|
| 230 |
|
array_unshift($columns, $column); |
| 231 |
|
$options['primary_key'] = $options['id']; |
| 232 |
|
} |
| 233 |
|
|
| 234 |
|
$sql = 'CREATE TABLE '; |
| 235 |
|
$sql .= $this->quoteTableName($table->getName()) . ' ('; |
src/Phinx/Db/Adapter/PostgresAdapter.php 1 location
|
@@ 204-213 (lines=10) @@
|
| 201 |
|
$options['id'] = 'id'; |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
if (isset($options['id']) && is_string($options['id'])) { |
| 205 |
|
// Handle id => "field_name" to support AUTO_INCREMENT |
| 206 |
|
$column = new Column(); |
| 207 |
|
$column->setName($options['id']) |
| 208 |
|
->setType('integer') |
| 209 |
|
->setIdentity(true); |
| 210 |
|
|
| 211 |
|
array_unshift($columns, $column); |
| 212 |
|
$options['primary_key'] = $options['id']; |
| 213 |
|
} |
| 214 |
|
|
| 215 |
|
// TODO - process table options like collation etc |
| 216 |
|
$sql = 'CREATE TABLE '; |