Code Duplication    Length = 20-20 lines in 2 locations

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

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