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

@@ 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()) . ' (';