Commit 0b20d850 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix for postgresql

parent 67729cec
...@@ -17,7 +17,7 @@ class MigrateProjectStatistics < ActiveRecord::Migration ...@@ -17,7 +17,7 @@ class MigrateProjectStatistics < ActiveRecord::Migration
end end
def down def down
add_column_with_default :projects, :repository_size, :float, default: 0.0 add_column :projects, :repository_size, :float, default: 0.0
add_column_with_default :projects, :commit_count, :integer, default: 0 add_column :projects, :commit_count, :integer, default: 0
end end
end end
...@@ -17,6 +17,6 @@ class AddLowerPathIndexToRoutes < ActiveRecord::Migration ...@@ -17,6 +17,6 @@ class AddLowerPathIndexToRoutes < ActiveRecord::Migration
def down def down
return unless Gitlab::Database.postgresql? return unless Gitlab::Database.postgresql?
remove_index :routes, name: :index_on_routes_lower_path remove_index :routes, name: :index_on_routes_lower_path if index_exists?(:routes, name: :index_on_routes_lower_path)
end end
end end
...@@ -8,4 +8,8 @@ class AddIndexToProjectAuthorizations < ActiveRecord::Migration ...@@ -8,4 +8,8 @@ class AddIndexToProjectAuthorizations < ActiveRecord::Migration
def up def up
add_concurrent_index(:project_authorizations, :project_id) add_concurrent_index(:project_authorizations, :project_id)
end end
def down
remove_index(:project_authorizations, :project_id)
end
end end
...@@ -5,7 +5,11 @@ class AddOwnerIdForeignKey < ActiveRecord::Migration ...@@ -5,7 +5,11 @@ class AddOwnerIdForeignKey < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def change def up
add_concurrent_foreign_key :ci_triggers, :users, column: :owner_id, on_delete: :cascade add_concurrent_foreign_key :ci_triggers, :users, column: :owner_id, on_delete: :cascade
end end
def down
remove_foreign_key :ci_triggers, column: :owner_id
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment