Code Duplication    Length = 18-18 lines in 2 locations

src/Phinx/Db/Adapter/PostgresAdapter.php 1 location

@@ 196-213 (lines=18) @@
193
        $parts = $this->getSchemaName($table->getName());
194
195
         // Add the default primary key
196
        if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) {
197
            $column = new Column();
198
            $column->setName('id')
199
                   ->setType('integer')
200
                   ->setIdentity(true);
201
202
            array_unshift($columns, $column);
203
            $options['primary_key'] = 'id';
204
        } elseif (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 ';

src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location

@@ 215-232 (lines=18) @@
212
        $options = $table->getOptions();
213
214
        // Add the default primary key
215
        if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) {
216
            $column = new Column();
217
            $column->setName('id')
218
                   ->setType('integer')
219
                   ->setIdentity(true);
220
221
            array_unshift($columns, $column);
222
            $options['primary_key'] = 'id';
223
        } elseif (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()) . ' (';