diff options
Diffstat (limited to 'db')
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 |