Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 177-194 (lines=18) @@
174
175
         // Add the default primary key
176
        $columns = $table->getPendingColumns();
177
        if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) {
178
            $column = new Column();
179
            $column->setName('id')
180
                   ->setType('integer')
181
                   ->setIdentity(true);
182
183
            array_unshift($columns, $column);
184
            $options['primary_key'] = 'id';
185
        } elseif (isset($options['id']) && is_string($options['id'])) {
186
            // Handle id => "field_name" to support AUTO_INCREMENT
187
            $column = new Column();
188
            $column->setName($options['id'])
189
                   ->setType('integer')
190
                   ->setIdentity(true);
191
192
            array_unshift($columns, $column);
193
            $options['primary_key'] = $options['id'];
194
        }
195
196
        // TODO - process table options like collation etc
197
        $sql = 'CREATE TABLE ';

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

@@ 218-235 (lines=18) @@
215
216
        // Add the default primary key
217
        $columns = $table->getPendingColumns();
218
        if (!isset($options['id']) || (isset($options['id']) && $options['id'] === true)) {
219
            $column = new Column();
220
            $column->setName('id')
221
                   ->setType('integer')
222
                   ->setIdentity(true);
223
224
            array_unshift($columns, $column);
225
            $options['primary_key'] = 'id';
226
        } elseif (isset($options['id']) && is_string($options['id'])) {
227
            // Handle id => "field_name" to support AUTO_INCREMENT
228
            $column = new Column();
229
            $column->setName($options['id'])
230
                   ->setType('integer')
231
                   ->setIdentity(true);
232
233
            array_unshift($columns, $column);
234
            $options['primary_key'] = $options['id'];
235
        }
236
237
        $sql = 'CREATE TABLE ';
238
        $sql .= $this->quoteTableName($table->getName()) . ' (';