Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 202-214 (lines=13) @@
199
            $options['id'] = 'id';
200
        }
201
202
        if (isset($options['id']) && is_string($options['id'])) {
203
            // Handle id => "field_name" to support AUTO_INCREMENT
204
            $column = new Column();
205
            $column->setName($options['id'])
206
                   ->setType('integer')
207
                   ->setIdentity(true);
208
209
            array_unshift($columns, $column);
210
            if (isset($options['primary_key']) && $options['id'] !== $options['primary_key'] && $options['id'] !== $options['primary_key'][0]) {
211
                throw new InvalidArgumentException('You cannot enable an auto incrementing ID field and a primary key');
212
            }
213
            $options['primary_key'] = $options['id'];
214
        }
215
216
        // TODO - process table options like collation etc
217
        $sql = 'CREATE TABLE ';

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

@@ 222-234 (lines=13) @@
219
            $options['id'] = 'id';
220
        }
221
222
        if (isset($options['id']) && is_string($options['id'])) {
223
            // Handle id => "field_name" to support AUTO_INCREMENT
224
            $column = new Column();
225
            $column->setName($options['id'])
226
                   ->setType('integer')
227
                   ->setIdentity(true);
228
229
            array_unshift($columns, $column);
230
            if (isset($options['primary_key']) && $options['id'] !== $options['primary_key'] && $options['id'] !== $options['primary_key'][0]) {
231
                throw new InvalidArgumentException('You cannot enable an auto incrementing ID field and a primary key');
232
            }
233
            $options['primary_key'] = $options['id'];
234
        }
235
236
        $sql = 'CREATE TABLE ';
237
        $sql .= $this->quoteTableName($table->getName()) . ' (';