Fix for postgresql

This commit is contained in:
Lin Jen-Shin 2017-03-14 14:36:33 +08:00
parent 67729cecc1
commit 0b20d850cb
4 changed files with 12 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class MigrateProjectStatistics < ActiveRecord::Migration
end
def down
add_column_with_default :projects, :repository_size, :float, default: 0.0
add_column_with_default :projects, :commit_count, :integer, default: 0
add_column :projects, :repository_size, :float, default: 0.0
add_column :projects, :commit_count, :integer, default: 0
end
end

View File

@ -17,6 +17,6 @@ class AddLowerPathIndexToRoutes < ActiveRecord::Migration
def down
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

View File

@ -8,4 +8,8 @@ class AddIndexToProjectAuthorizations < ActiveRecord::Migration
def up
add_concurrent_index(:project_authorizations, :project_id)
end
def down
remove_index(:project_authorizations, :project_id)
end
end

View File

@ -5,7 +5,11 @@ class AddOwnerIdForeignKey < ActiveRecord::Migration
disable_ddl_transaction!
def change
def up
add_concurrent_foreign_key :ci_triggers, :users, column: :owner_id, on_delete: :cascade
end
def down
remove_foreign_key :ci_triggers, column: :owner_id
end
end