Code Duplication    Length = 20-20 lines in 2 locations

eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/RegenerateUrlAliasesCommand.php 2 locations

@@ 960-979 (lines=20) @@
957
    /**
958
     * Creates database table for custom Location URL alias backup.
959
     */
960
    protected function createCustomLocationUrlAliasBackupTable()
961
    {
962
        $schema = new Schema();
963
964
        $table = $schema->createTable(static::CUSTOM_ALIAS_BACKUP_TABLE);
965
966
        $table->addColumn('id', 'integer', ['autoincrement' => true]);
967
        $table->addColumn('location_id', 'integer');
968
        $table->addColumn('path', 'text');
969
        $table->addColumn('language_code', 'string');
970
        $table->addColumn('always_available', 'integer');
971
        $table->addColumn('forwarding', 'integer');
972
        $table->setPrimaryKey(['id']);
973
974
        $queries = $schema->toSql($this->connection->getDatabasePlatform());
975
976
        foreach ($queries as $query) {
977
            $this->connection->exec($query);
978
        }
979
    }
980
981
    /**
982
     * Creates database table for custom URL alias backup.
@@ 984-1003 (lines=20) @@
981
    /**
982
     * Creates database table for custom URL alias backup.
983
     */
984
    protected function createGlobalUrlAliasBackupTable()
985
    {
986
        $schema = new Schema();
987
988
        $table = $schema->createTable(static::GLOBAL_ALIAS_BACKUP_TABLE);
989
990
        $table->addColumn('id', 'integer', ['autoincrement' => true]);
991
        $table->addColumn('resource', 'text');
992
        $table->addColumn('path', 'text');
993
        $table->addColumn('language_code', 'string');
994
        $table->addColumn('always_available', 'integer');
995
        $table->addColumn('forwarding', 'integer');
996
        $table->setPrimaryKey(['id']);
997
998
        $queries = $schema->toSql($this->connection->getDatabasePlatform());
999
1000
        foreach ($queries as $query) {
1001
            $this->connection->exec($query);
1002
        }
1003
    }
1004
1005
    /**
1006
     * Checks if database table $name exists.