diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 12:07:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 12:07:33 +0300 |
commit | c0d8f9f3f962df6bfcc70440432da55d67307189 (patch) | |
tree | 457666705fbbd4f517d201680113406163829fcc /db | |
parent | 2cfa1fc75dd4bd6d1f70d5fee1a824410694f297 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191205212923_support_multiple_milestones_for_issues.rb | 14 | ||||
-rw-r--r-- | db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb | 14 | ||||
-rw-r--r-- | db/schema.rb | 20 |
3 files changed, 48 insertions, 0 deletions
diff --git a/db/migrate/20191205212923_support_multiple_milestones_for_issues.rb b/db/migrate/20191205212923_support_multiple_milestones_for_issues.rb new file mode 100644 index 00000000000..e0edd76c4b9 --- /dev/null +++ b/db/migrate/20191205212923_support_multiple_milestones_for_issues.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class SupportMultipleMilestonesForIssues < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :issue_milestones, id: false do |t| + t.references :issue, foreign_key: { on_delete: :cascade }, index: { unique: true }, null: false + t.references :milestone, foreign_key: { on_delete: :cascade }, index: true, null: false + end + + add_index :issue_milestones, [:issue_id, :milestone_id], unique: true + end +end diff --git a/db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb b/db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb new file mode 100644 index 00000000000..85ad1a748e9 --- /dev/null +++ b/db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class SupportMultipleMilestonesForMergeRequests < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :merge_request_milestones, id: false do |t| + t.references :merge_request, foreign_key: { on_delete: :cascade }, index: { unique: true }, null: false + t.references :milestone, foreign_key: { on_delete: :cascade }, index: true, null: false + end + + add_index :merge_request_milestones, [:merge_request_id, :milestone_id], name: 'index_mrs_milestones_on_mr_id_and_milestone_id', unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 5a877870e6c..567e135fdff 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2099,6 +2099,14 @@ ActiveRecord::Schema.define(version: 2019_12_29_140154) do t.index ["issue_id"], name: "index_issue_metrics" end + create_table "issue_milestones", id: false, force: :cascade do |t| + t.bigint "issue_id", null: false + t.bigint "milestone_id", null: false + t.index ["issue_id", "milestone_id"], name: "index_issue_milestones_on_issue_id_and_milestone_id", unique: true + t.index ["issue_id"], name: "index_issue_milestones_on_issue_id", unique: true + t.index ["milestone_id"], name: "index_issue_milestones_on_milestone_id" + end + create_table "issue_tracker_data", force: :cascade do |t| t.integer "service_id", null: false t.datetime_with_timezone "created_at", null: false @@ -2486,6 +2494,14 @@ ActiveRecord::Schema.define(version: 2019_12_29_140154) do t.index ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id" end + create_table "merge_request_milestones", id: false, force: :cascade do |t| + t.bigint "merge_request_id", null: false + t.bigint "milestone_id", null: false + t.index ["merge_request_id", "milestone_id"], name: "index_mrs_milestones_on_mr_id_and_milestone_id", unique: true + t.index ["merge_request_id"], name: "index_merge_request_milestones_on_merge_request_id", unique: true + t.index ["milestone_id"], name: "index_merge_request_milestones_on_milestone_id" + end + create_table "merge_request_user_mentions", force: :cascade do |t| t.integer "merge_request_id", null: false t.integer "note_id" @@ -4595,6 +4611,8 @@ ActiveRecord::Schema.define(version: 2019_12_29_140154) do add_foreign_key "issue_links", "issues", column: "source_id", name: "fk_c900194ff2", on_delete: :cascade add_foreign_key "issue_links", "issues", column: "target_id", name: "fk_e71bb44f1f", on_delete: :cascade add_foreign_key "issue_metrics", "issues", on_delete: :cascade + add_foreign_key "issue_milestones", "issues", on_delete: :cascade + add_foreign_key "issue_milestones", "milestones", on_delete: :cascade add_foreign_key "issue_tracker_data", "services", on_delete: :cascade add_foreign_key "issue_user_mentions", "issues", on_delete: :cascade add_foreign_key "issue_user_mentions", "notes", on_delete: :cascade @@ -4638,6 +4656,8 @@ ActiveRecord::Schema.define(version: 2019_12_29_140154) do add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade add_foreign_key "merge_request_metrics", "users", column: "latest_closed_by_id", name: "fk_ae440388cc", on_delete: :nullify add_foreign_key "merge_request_metrics", "users", column: "merged_by_id", name: "fk_7f28d925f3", on_delete: :nullify + add_foreign_key "merge_request_milestones", "merge_requests", on_delete: :cascade + add_foreign_key "merge_request_milestones", "milestones", on_delete: :cascade add_foreign_key "merge_request_user_mentions", "merge_requests", on_delete: :cascade add_foreign_key "merge_request_user_mentions", "notes", on_delete: :cascade add_foreign_key "merge_requests", "ci_pipelines", column: "head_pipeline_id", name: "fk_fd82eae0b9", on_delete: :nullify |