diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-21 00:06:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-21 00:06:02 +0000 |
commit | 96f3246b9ca41d27d1e268ac3fc90326ad0714ba (patch) | |
tree | 2b0e7426d4aae6dd7461ccdb4c5be315313254ab /db | |
parent | 2477ab5553eabc6c4579cb23aba620ffc8cba228 (diff) | |
download | gitlab-ce-96f3246b9ca41d27d1e268ac3fc90326ad0714ba.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb | 16 | ||||
-rw-r--r-- | db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb | 22 | ||||
-rw-r--r-- | db/schema.rb | 3 |
3 files changed, 41 insertions, 0 deletions
diff --git a/db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb b/db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb new file mode 100644 index 00000000000..158dbf69bcc --- /dev/null +++ b/db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddPromotedToEpicToIssues < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def up + add_column :issues, :promoted_to_epic_id, :integer + end + + def down + remove_column :issues, :promoted_to_epic_id + end +end diff --git a/db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb b/db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb new file mode 100644 index 00000000000..649c2f7abe5 --- /dev/null +++ b/db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddPromotedToEpicToIssuesIndex < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :issues, :epics, column: :promoted_to_epic_id, on_delete: :nullify + add_concurrent_index :issues, :promoted_to_epic_id, where: 'promoted_to_epic_id IS NOT NULL' + end + + def down + remove_concurrent_index(:issues, :promoted_to_epic_id) + remove_foreign_key :issues, column: :promoted_to_epic_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 41757457a52..21d045be380 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2049,6 +2049,7 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do t.integer "closed_by_id" t.integer "state_id", limit: 2, default: 1, null: false t.integer "duplicated_to_id" + t.integer "promoted_to_epic_id" t.index ["author_id"], name: "index_issues_on_author_id" t.index ["closed_by_id"], name: "index_issues_on_closed_by_id" t.index ["confidential"], name: "index_issues_on_confidential" @@ -2065,6 +2066,7 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do t.index ["project_id", "relative_position", "state_id", "id"], name: "idx_issues_on_project_id_and_rel_position_and_state_id_and_id", order: { id: :desc } t.index ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state" t.index ["project_id", "updated_at", "id", "state_id"], name: "idx_issues_on_project_id_and_updated_at_and_id_and_state_id" + t.index ["promoted_to_epic_id"], name: "index_issues_on_promoted_to_epic_id", where: "(promoted_to_epic_id IS NOT NULL)" t.index ["relative_position"], name: "index_issues_on_relative_position" t.index ["state"], name: "index_issues_on_state" t.index ["state_id"], name: "idx_issues_on_state_id" @@ -4428,6 +4430,7 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do 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 + add_foreign_key "issues", "epics", column: "promoted_to_epic_id", name: "fk_df75a7c8b8", on_delete: :nullify add_foreign_key "issues", "issues", column: "duplicated_to_id", name: "fk_9c4516d665", on_delete: :nullify add_foreign_key "issues", "issues", column: "moved_to_id", name: "fk_a194299be1", on_delete: :nullify add_foreign_key "issues", "milestones", name: "fk_96b1dd429c", on_delete: :nullify |