Code Duplication    Length = 18-18 lines in 2 locations

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

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