summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-09-20 16:31:52 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-09-20 16:31:52 +0530
commit8747f29db7d5f00ff48972097573f722d6b71627 (patch)
tree69de3c379f5befeb7b1d83ad5da286838c8f97f3 /db
parent9691d7e226da7bb468b3dc5ad410d21f8df4c243 (diff)
downloadgitlab-ce-8747f29db7d5f00ff48972097573f722d6b71627.tar.gz
Fix `ON DELETE CASCADE` migrations.
Incorrect syntax.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160824124900_add_table_issue_metrics.rb2
-rw-r--r--db/migrate/20160825052008_add_table_merge_request_metrics.rb2
-rw-r--r--db/migrate/20160915042921_create_merge_requests_closing_issues.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/db/migrate/20160824124900_add_table_issue_metrics.rb b/db/migrate/20160824124900_add_table_issue_metrics.rb
index 3d296c7e884..e9bb79b3c62 100644
--- a/db/migrate/20160824124900_add_table_issue_metrics.rb
+++ b/db/migrate/20160824124900_add_table_issue_metrics.rb
@@ -25,7 +25,7 @@ class AddTableIssueMetrics < ActiveRecord::Migration
def change
create_table :issue_metrics do |t|
- t.references :issue, index: { name: "index_issue_metrics" }, foreign_key: true, dependent: :delete, null: false
+ t.references :issue, index: { name: "index_issue_metrics" }, foreign_key: { on_delete: :cascade }, null: false
t.datetime 'first_mentioned_in_commit_at'
t.datetime 'first_associated_with_milestone_at'
diff --git a/db/migrate/20160825052008_add_table_merge_request_metrics.rb b/db/migrate/20160825052008_add_table_merge_request_metrics.rb
index d743134d9a2..bde9238b3c6 100644
--- a/db/migrate/20160825052008_add_table_merge_request_metrics.rb
+++ b/db/migrate/20160825052008_add_table_merge_request_metrics.rb
@@ -25,7 +25,7 @@ class AddTableMergeRequestMetrics < ActiveRecord::Migration
def change
create_table :merge_request_metrics do |t|
- t.references :merge_request, index: { name: "index_merge_request_metrics" }, foreign_key: true, dependent: :delete, null: false
+ t.references :merge_request, index: { name: "index_merge_request_metrics" }, foreign_key: { on_delete: :cascade }, null: false
t.datetime 'latest_build_started_at'
t.datetime 'latest_build_finished_at'
diff --git a/db/migrate/20160915042921_create_merge_requests_closing_issues.rb b/db/migrate/20160915042921_create_merge_requests_closing_issues.rb
index 049340f7085..94874a853da 100644
--- a/db/migrate/20160915042921_create_merge_requests_closing_issues.rb
+++ b/db/migrate/20160915042921_create_merge_requests_closing_issues.rb
@@ -25,8 +25,8 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
def change
create_table :merge_requests_closing_issues do |t|
- t.references :merge_request, foreign_key: true, index: true, dependent: :delete, null: false
- t.references :issue, foreign_key: true, index: true, dependent: :delete, null: false
+ t.references :merge_request, foreign_key: { on_delete: :cascade }, index: true, null: false
+ t.references :issue, foreign_key: { on_delete: :cascade }, index: true, null: false
t.timestamps null: false
end