diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 18:09:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 18:09:36 +0300 |
commit | e0655935eb32ba057b6ced978940076681d71177 (patch) | |
tree | b931975665fc002f346bdd3c5242fe644316f86c /db | |
parent | 8322f051740fba113c5c1f6fba96b9c943240746 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20201202003042_add_epic_board_positions.rb | 27 | ||||
-rw-r--r-- | db/schema_migrations/20201202003042 | 1 | ||||
-rw-r--r-- | db/structure.sql | 33 |
3 files changed, 61 insertions, 0 deletions
diff --git a/db/migrate/20201202003042_add_epic_board_positions.rb b/db/migrate/20201202003042_add_epic_board_positions.rb new file mode 100644 index 00000000000..528d5ed3af1 --- /dev/null +++ b/db/migrate/20201202003042_add_epic_board_positions.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AddEpicBoardPositions < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + create_table :boards_epic_board_positions do |t| + t.references :epic_board, foreign_key: { to_table: :boards_epic_boards, on_delete: :cascade }, null: false, index: false + t.references :epic, foreign_key: { on_delete: :cascade }, null: false, index: true + t.integer :relative_position + + t.timestamps_with_timezone null: false + + t.index [:epic_board_id, :epic_id], unique: true, name: :index_boards_epic_board_positions_on_epic_board_id_and_epic_id + end + end + end + + def down + with_lock_retries do + drop_table :boards_epic_board_positions + end + end +end diff --git a/db/schema_migrations/20201202003042 b/db/schema_migrations/20201202003042 new file mode 100644 index 00000000000..13bbfe9f8af --- /dev/null +++ b/db/schema_migrations/20201202003042 @@ -0,0 +1 @@ +779effb1db70aa8b9a24942ec3e0681064c01b69ee4731f82477c54361a670b0
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 9c53bb2de03..385183bb176 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9864,6 +9864,24 @@ CREATE SEQUENCE boards_epic_board_labels_id_seq ALTER SEQUENCE boards_epic_board_labels_id_seq OWNED BY boards_epic_board_labels.id; +CREATE TABLE boards_epic_board_positions ( + id bigint NOT NULL, + epic_board_id bigint NOT NULL, + epic_id bigint NOT NULL, + relative_position integer, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE boards_epic_board_positions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_board_positions_id_seq OWNED BY boards_epic_board_positions.id; + CREATE TABLE boards_epic_boards ( id bigint NOT NULL, hide_backlog_list boolean DEFAULT false NOT NULL, @@ -17920,6 +17938,8 @@ ALTER TABLE ONLY boards ALTER COLUMN id SET DEFAULT nextval('boards_id_seq'::reg ALTER TABLE ONLY boards_epic_board_labels ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_labels_id_seq'::regclass); +ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_positions_id_seq'::regclass); + ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass); ALTER TABLE ONLY boards_epic_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_user_preferences_id_seq'::regclass); @@ -18953,6 +18973,9 @@ ALTER TABLE ONLY board_user_preferences ALTER TABLE ONLY boards_epic_board_labels ADD CONSTRAINT boards_epic_board_labels_pkey PRIMARY KEY (id); +ALTER TABLE ONLY boards_epic_board_positions + ADD CONSTRAINT boards_epic_board_positions_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_boards ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id); @@ -20582,6 +20605,10 @@ CREATE INDEX index_boards_epic_board_labels_on_epic_board_id ON boards_epic_boar CREATE INDEX index_boards_epic_board_labels_on_label_id ON boards_epic_board_labels USING btree (label_id); +CREATE UNIQUE INDEX index_boards_epic_board_positions_on_epic_board_id_and_epic_id ON boards_epic_board_positions USING btree (epic_board_id, epic_id); + +CREATE INDEX index_boards_epic_board_positions_on_epic_id ON boards_epic_board_positions USING btree (epic_id); + CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_id); CREATE INDEX index_boards_epic_user_preferences_on_board_id ON boards_epic_user_preferences USING btree (board_id); @@ -23844,6 +23871,9 @@ ALTER TABLE ONLY approver_groups ALTER TABLE ONLY packages_tags ADD CONSTRAINT fk_rails_1dfc868911 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_positions + ADD CONSTRAINT fk_rails_1ecfd9f2de FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_repository_created_events ADD CONSTRAINT fk_rails_1f49e46a61 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24771,6 +24801,9 @@ ALTER TABLE ONLY gpg_signatures ALTER TABLE ONLY board_group_recent_visits ADD CONSTRAINT fk_rails_ca04c38720 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_positions + ADD CONSTRAINT fk_rails_cb4563dd6e FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT fk_rails_cbdfde27ce FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; |