Code Duplication    Length = 29-29 lines in 2 locations

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

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

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

@@ 323-351 (lines=29) @@
320
     */
321
    public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime)
322
    {
323
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
324
            // up
325
            $sql = sprintf(
326
                "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES ('%s', '%s', '%s', '%s', %s);",
327
                $this->quoteTableName($this->getSchemaTableName()),
328
                $this->quoteColumnName('version'),
329
                $this->quoteColumnName('migration_name'),
330
                $this->quoteColumnName('start_time'),
331
                $this->quoteColumnName('end_time'),
332
                $this->quoteColumnName('breakpoint'),
333
                $migration->getVersion(),
334
                substr($migration->getName(), 0, 100),
335
                $startTime,
336
                $endTime,
337
                $this->castToBool(false)
338
            );
339
340
            $this->execute($sql);
341
        } else {
342
            // down
343
            $sql = sprintf(
344
                "DELETE FROM %s WHERE %s = '%s'",
345
                $this->quoteTableName($this->getSchemaTableName()),
346
                $this->quoteColumnName('version'),
347
                $migration->getVersion()
348
            );
349
350
            $this->execute($sql);
351
        }
352
353
        return $this;
354
    }