Code Duplication    Length = 29-29 lines in 2 locations

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

@@ 996-1024 (lines=29) @@
993
        $startTime = "TO_TIMESTAMP('$startTime', 'YYYY-MM-DD HH24:MI:SS')";
994
        $endTime = "TO_TIMESTAMP('$endTime', 'YYYY-MM-DD HH24:MI:SS')";
995
996
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
997
            // up
998
            $sql = sprintf(
999
                "INSERT INTO \"%s\" (%s, %s, %s, %s, %s) VALUES ('%s', '%s', %s, %s, %s)",
1000
                $this->getSchemaTableName(),
1001
                $this->quoteColumnName('version'),
1002
                $this->quoteColumnName('migration_name'),
1003
                $this->quoteColumnName('start_time'),
1004
                $this->quoteColumnName('end_time'),
1005
                $this->quoteColumnName('breakpoint'),
1006
                $migration->getVersion(),
1007
                substr($migration->getName(), 0, 100),
1008
                $startTime,
1009
                $endTime,
1010
                $this->castToBool(false)
1011
            );
1012
1013
            $this->execute($sql);
1014
        } else {
1015
            // down
1016
            $sql = sprintf(
1017
                "DELETE FROM \"%s\" WHERE %s = '%s'",
1018
                $this->getSchemaTableName(),
1019
                $this->quoteColumnName('version'),
1020
                $migration->getVersion()
1021
            );
1022
1023
            $this->execute($sql);
1024
        }
1025
1026
        return $this;
1027
    }

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

@@ 263-291 (lines=29) @@
260
     */
261
    public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime)
262
    {
263
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
264
            // up
265
            $sql = sprintf(
266
                "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES ('%s', '%s', '%s', '%s', %s);",
267
                $this->getSchemaTableName(),
268
                $this->quoteColumnName('version'),
269
                $this->quoteColumnName('migration_name'),
270
                $this->quoteColumnName('start_time'),
271
                $this->quoteColumnName('end_time'),
272
                $this->quoteColumnName('breakpoint'),
273
                $migration->getVersion(),
274
                substr($migration->getName(), 0, 100),
275
                $startTime,
276
                $endTime,
277
                $this->castToBool(false)
278
            );
279
280
            $this->execute($sql);
281
        } else {
282
            // down
283
            $sql = sprintf(
284
                "DELETE FROM %s WHERE %s = '%s'",
285
                $this->getSchemaTableName(),
286
                $this->quoteColumnName('version'),
287
                $migration->getVersion()
288
            );
289
290
            $this->execute($sql);
291
        }
292
293
        return $this;
294
    }