diff --git a/db/migrate/20170216141440_drop_index_for_builds_project_status.rb b/db/migrate/20170216141440_drop_index_for_builds_project_status.rb index 906711b9f3f9caedd96b9401344c63a6736d4007..a2839f52d89c102934c7979f82b8810a3b160a61 100644 --- a/db/migrate/20170216141440_drop_index_for_builds_project_status.rb +++ b/db/migrate/20170216141440_drop_index_for_builds_project_status.rb @@ -3,6 +3,6 @@ class DropIndexForBuildsProjectStatus < ActiveRecord::Migration DOWNTIME = false def change - remove_index(:ci_commits, [:gl_project_id, :status]) + remove_index(:ci_commits, column: [:gl_project_id, :status]) end end diff --git a/db/migrate/20170305203726_add_owner_id_foreign_key.rb b/db/migrate/20170305203726_add_owner_id_foreign_key.rb index 3eece0e2eb5edd18c3793bf4f378b611959ae9e3..5fbdc45f1a748e0ba19942413fc951ee0bbf626f 100644 --- a/db/migrate/20170305203726_add_owner_id_foreign_key.rb +++ b/db/migrate/20170305203726_add_owner_id_foreign_key.rb @@ -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