execute"DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_PERM};"
execute"DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_PERM};"
execute"DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_TEMP};"
execute"DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_TEMP};"
end
end
end
remove_column(:redirect_routes,:permanent)
remove_column(:redirect_routes,:permanent)
end
end
...
@@ -28,10 +28,10 @@ class RemovePermanentFromRedirectRoutes < ActiveRecord::Migration
...
@@ -28,10 +28,10 @@ class RemovePermanentFromRedirectRoutes < ActiveRecord::Migration
add_column(:redirect_routes,:permanent,:boolean)
add_column(:redirect_routes,:permanent,:boolean)
ifGitlab::Database.postgresql?
ifGitlab::Database.postgresql?
disable_statement_timeout
disable_statement_timeout(transaction: false)do
execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_PERM} ON redirect_routes (lower(path) varchar_pattern_ops) where (permanent);")
execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_PERM} ON redirect_routes (lower(path) varchar_pattern_ops) where (permanent);")
execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_TEMP} ON redirect_routes (lower(path) varchar_pattern_ops) where (not permanent or permanent is null) ;")
execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_TEMP} ON redirect_routes (lower(path) varchar_pattern_ops) where (not permanent or permanent is null) ;")