summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2017-03-14 19:06:54 -0700
committerDJ Mountney <david@twkie.net>2017-03-14 19:06:54 -0700
commitfbbaff4a7141fbecca08e087f923c700290a6a74 (patch)
treef218a27f0d9d523d05f79c393126c2cffac02e52
parent8fddde5b9f97feaa0c62f8c4a3e5441d20989165 (diff)
downloadgitlab-ce-fix-migration-rc1-rollback.tar.gz
Fixing two migrations that could not be rolled backfix-migration-rc1-rollback
when rolling back from 9-0-stable to 8.17.3
-rw-r--r--db/migrate/20170216141440_drop_index_for_builds_project_status.rb2
-rw-r--r--db/migrate/20170305203726_add_owner_id_foreign_key.rb6
2 files changed, 6 insertions, 2 deletions
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 906711b9f3f..a2839f52d89 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 3eece0e2eb5..5fbdc45f1a7 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