Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-03 00:09:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-03 00:09:44 +0300
commitf96f2720d1b21b76eadedc54fdea67cb70e98d94 (patch)
tree527d27d5ceb816969e315b6223b3ddb2ca128dae /db
parentad05e1db038a2e983d25555144fa29063e060c50 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20201126165919_add_epic_boards.rb29
-rw-r--r--db/migrate/20201126190039_add_epic_board_labels.rb24
-rw-r--r--db/migrate/20201202025644_add_column_to_security_findings.rb9
-rw-r--r--db/migrate/20201202025937_add_index_to_security_findings_uuid.rb18
-rw-r--r--db/schema_migrations/202011261659191
-rw-r--r--db/schema_migrations/202011261900391
-rw-r--r--db/schema_migrations/202012020256441
-rw-r--r--db/schema_migrations/202012020259371
-rw-r--r--db/structure.sql63
9 files changed, 147 insertions, 0 deletions
diff --git a/db/migrate/20201126165919_add_epic_boards.rb b/db/migrate/20201126165919_add_epic_boards.rb
new file mode 100644
index 00000000000..432b839d6ea
--- /dev/null
+++ b/db/migrate/20201126165919_add_epic_boards.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class AddEpicBoards < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ create_table :boards_epic_boards do |t|
+ t.boolean :hide_backlog_list, default: false, null: false
+ t.boolean :hide_closed_list, default: false, null: false
+ t.references :group, index: true, foreign_key: { to_table: :namespaces, on_delete: :cascade }, null: false
+ t.timestamps_with_timezone
+ t.text :name, default: 'Development', null: false
+ end
+ end
+
+ add_text_limit :boards_epic_boards, :name, 255
+ end
+
+ def down
+ with_lock_retries do
+ drop_table :boards_epic_boards
+ end
+ end
+end
diff --git a/db/migrate/20201126190039_add_epic_board_labels.rb b/db/migrate/20201126190039_add_epic_board_labels.rb
new file mode 100644
index 00000000000..519e705ce14
--- /dev/null
+++ b/db/migrate/20201126190039_add_epic_board_labels.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class AddEpicBoardLabels < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ create_table :boards_epic_board_labels do |t|
+ t.references :epic_board, index: true, foreign_key: { to_table: :boards_epic_boards, on_delete: :cascade }, null: false
+ t.references :label, index: true, foreign_key: { on_delete: :cascade }, null: false
+ end
+ end
+ end
+
+ def down
+ with_lock_retries do
+ drop_table :boards_epic_board_labels
+ end
+ end
+end
diff --git a/db/migrate/20201202025644_add_column_to_security_findings.rb b/db/migrate/20201202025644_add_column_to_security_findings.rb
new file mode 100644
index 00000000000..0b63b79d949
--- /dev/null
+++ b/db/migrate/20201202025644_add_column_to_security_findings.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+#
+class AddColumnToSecurityFindings < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ add_column :security_findings, :uuid, :uuid
+ end
+end
diff --git a/db/migrate/20201202025937_add_index_to_security_findings_uuid.rb b/db/migrate/20201202025937_add_index_to_security_findings_uuid.rb
new file mode 100644
index 00000000000..4c33809fbfc
--- /dev/null
+++ b/db/migrate/20201202025937_add_index_to_security_findings_uuid.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexToSecurityFindingsUuid < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_security_findings_on_uuid'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :security_findings, :uuid, name: INDEX_NAME, unique: true
+ end
+
+ def down
+ remove_concurrent_index_by_name :security_findings, INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20201126165919 b/db/schema_migrations/20201126165919
new file mode 100644
index 00000000000..533273ec9a2
--- /dev/null
+++ b/db/schema_migrations/20201126165919
@@ -0,0 +1 @@
+a68c609800f5bdb0a77e39f706b410477493e7b7db3af11e4b2a67534df31079 \ No newline at end of file
diff --git a/db/schema_migrations/20201126190039 b/db/schema_migrations/20201126190039
new file mode 100644
index 00000000000..0e70a7e92bf
--- /dev/null
+++ b/db/schema_migrations/20201126190039
@@ -0,0 +1 @@
+65935afe9b4ad195aaf31cddb915dcd62b23674e278e93ce7ff9b4ae98e32331 \ No newline at end of file
diff --git a/db/schema_migrations/20201202025644 b/db/schema_migrations/20201202025644
new file mode 100644
index 00000000000..189704a6d1e
--- /dev/null
+++ b/db/schema_migrations/20201202025644
@@ -0,0 +1 @@
+3b0e685327e2199e0a6721e00d1fa3c9fee3a173ce1cf5ddd99df3349a28fea9 \ No newline at end of file
diff --git a/db/schema_migrations/20201202025937 b/db/schema_migrations/20201202025937
new file mode 100644
index 00000000000..eb2088259a5
--- /dev/null
+++ b/db/schema_migrations/20201202025937
@@ -0,0 +1 @@
+d0706f4a60ae6f26be206aee80fdeb4a7e5c4c0b99e518140ae3cb8c47ed7a82 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index eea70338aeb..8f4774d6467 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -9849,6 +9849,41 @@ CREATE TABLE boards (
hide_closed_list boolean DEFAULT false NOT NULL
);
+CREATE TABLE boards_epic_board_labels (
+ id bigint NOT NULL,
+ epic_board_id bigint NOT NULL,
+ label_id bigint NOT NULL
+);
+
+CREATE SEQUENCE boards_epic_board_labels_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE boards_epic_board_labels_id_seq OWNED BY boards_epic_board_labels.id;
+
+CREATE TABLE boards_epic_boards (
+ id bigint NOT NULL,
+ hide_backlog_list boolean DEFAULT false NOT NULL,
+ hide_closed_list boolean DEFAULT false NOT NULL,
+ group_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text DEFAULT 'Development'::text NOT NULL,
+ CONSTRAINT check_bcbbffe601 CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE boards_epic_boards_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE boards_epic_boards_id_seq OWNED BY boards_epic_boards.id;
+
CREATE TABLE boards_epic_user_preferences (
id bigint NOT NULL,
board_id bigint NOT NULL,
@@ -16202,6 +16237,7 @@ CREATE TABLE security_findings (
project_fingerprint text NOT NULL,
deduplicated boolean DEFAULT false NOT NULL,
"position" integer,
+ uuid uuid,
CONSTRAINT check_b9508c6df8 CHECK ((char_length(project_fingerprint) <= 40))
);
@@ -17878,6 +17914,10 @@ ALTER TABLE ONLY board_user_preferences ALTER COLUMN id SET DEFAULT nextval('boa
ALTER TABLE ONLY boards ALTER COLUMN id SET DEFAULT nextval('boards_id_seq'::regclass);
+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_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);
ALTER TABLE ONLY broadcast_messages ALTER COLUMN id SET DEFAULT nextval('broadcast_messages_id_seq'::regclass);
@@ -18906,6 +18946,12 @@ ALTER TABLE ONLY board_project_recent_visits
ALTER TABLE ONLY board_user_preferences
ADD CONSTRAINT board_user_preferences_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY boards_epic_board_labels
+ ADD CONSTRAINT boards_epic_board_labels_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY boards_epic_boards
+ ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY boards_epic_user_preferences
ADD CONSTRAINT boards_epic_user_preferences_pkey PRIMARY KEY (id);
@@ -20525,6 +20571,12 @@ CREATE INDEX index_board_user_preferences_on_user_id ON board_user_preferences U
CREATE UNIQUE INDEX index_board_user_preferences_on_user_id_and_board_id ON board_user_preferences USING btree (user_id, board_id);
+CREATE INDEX index_boards_epic_board_labels_on_epic_board_id ON boards_epic_board_labels USING btree (epic_board_id);
+
+CREATE INDEX index_boards_epic_board_labels_on_label_id ON boards_epic_board_labels USING btree (label_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);
CREATE UNIQUE INDEX index_boards_epic_user_preferences_on_board_user_epic_unique ON boards_epic_user_preferences USING btree (board_id, user_id, epic_id);
@@ -22213,6 +22265,8 @@ CREATE INDEX index_security_findings_on_scanner_id ON security_findings USING bt
CREATE INDEX index_security_findings_on_severity ON security_findings USING btree (severity);
+CREATE UNIQUE INDEX index_security_findings_on_uuid ON security_findings USING btree (uuid);
+
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
@@ -23844,6 +23898,9 @@ ALTER TABLE ONLY group_group_links
ALTER TABLE ONLY geo_repository_updated_events
ADD CONSTRAINT fk_rails_2b70854c08 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY boards_epic_board_labels
+ ADD CONSTRAINT fk_rails_2bedeb8799 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_2d2aba21ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -24249,6 +24306,9 @@ ALTER TABLE ONLY slack_integrations
ALTER TABLE ONLY custom_emoji
ADD CONSTRAINT fk_rails_745925b412 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY boards_epic_board_labels
+ ADD CONSTRAINT fk_rails_7471128a8e FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_site_profiles
ADD CONSTRAINT fk_rails_747dc64abc FOREIGN KEY (dast_site_id) REFERENCES dast_sites(id) ON DELETE CASCADE;
@@ -24333,6 +24393,9 @@ ALTER TABLE ONLY clusters_applications_crossplane
ALTER TABLE ONLY packages_package_file_build_infos
ADD CONSTRAINT fk_rails_871ca3ae21 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE;
+ALTER TABLE ONLY boards_epic_boards
+ ADD CONSTRAINT fk_rails_874c573878 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_runner_namespaces
ADD CONSTRAINT fk_rails_8767676b7a FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE;