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>2021-12-02 09:15:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-02 09:15:23 +0300
commit377b57afa8292caa96921fac7daf6279e12304de (patch)
tree6ff9a8ee8918be5cb0fa9944a83b04c56080a4ac /db
parentedfc0f680fdfbad9c4de23dba11caaf40b59be75 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20211115132613_create_incident_management_timeline_events.rb30
-rw-r--r--db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb15
-rw-r--r--db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb15
-rw-r--r--db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb15
-rw-r--r--db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb15
-rw-r--r--db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb15
-rw-r--r--db/schema_migrations/202111151326131
-rw-r--r--db/schema_migrations/202111151428031
-rw-r--r--db/schema_migrations/202111151428471
-rw-r--r--db/schema_migrations/202111151429111
-rw-r--r--db/schema_migrations/202111160937391
-rw-r--r--db/schema_migrations/202111301517241
-rw-r--r--db/structure.sql59
13 files changed, 170 insertions, 0 deletions
diff --git a/db/migrate/20211115132613_create_incident_management_timeline_events.rb b/db/migrate/20211115132613_create_incident_management_timeline_events.rb
new file mode 100644
index 00000000000..217dcd27b4c
--- /dev/null
+++ b/db/migrate/20211115132613_create_incident_management_timeline_events.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class CreateIncidentManagementTimelineEvents < Gitlab::Database::Migration[1.0]
+ def up
+ create_table :incident_management_timeline_events do |t|
+ t.timestamps_with_timezone null: false
+ t.datetime_with_timezone :occurred_at, null: false
+ t.bigint :project_id, null: false
+ t.bigint :author_id
+ t.bigint :issue_id, null: false
+ t.bigint :updated_by_user_id
+ t.bigint :promoted_from_note_id
+ t.integer :cached_markdown_version
+ t.boolean :editable, null: false, default: false
+ t.text :note, limit: 10_000, null: false
+ t.text :note_html, limit: 10_000, null: false
+ t.text :action, limit: 128, null: false
+
+ t.index :project_id, name: 'index_im_timeline_events_project_id'
+ t.index :author_id, name: 'index_im_timeline_events_author_id'
+ t.index :issue_id, name: 'index_im_timeline_events_issue_id'
+ t.index :updated_by_user_id, name: 'index_im_timeline_events_updated_by_user_id'
+ t.index :promoted_from_note_id, name: 'index_im_timeline_events_promoted_from_note_id'
+ end
+ end
+
+ def down
+ drop_table :incident_management_timeline_events
+ end
+end
diff --git a/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb b/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb
new file mode 100644
index 00000000000..893043cc1ab
--- /dev/null
+++ b/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToIncidentManagementTimelineEventsOnProject < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :incident_management_timeline_events, :projects, column: :project_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :incident_management_timeline_events, column: :project_id
+ end
+ end
+end
diff --git a/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb b/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb
new file mode 100644
index 00000000000..0f5886eb5ed
--- /dev/null
+++ b/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToIncidentManagementTimelineEventsOnUser < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :incident_management_timeline_events, :users, column: :author_id, on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :incident_management_timeline_events, column: :author_id
+ end
+ end
+end
diff --git a/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb b/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb
new file mode 100644
index 00000000000..bdcf7f389d1
--- /dev/null
+++ b/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToIncidentManagementTimelineEventsOnIssue < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :incident_management_timeline_events, :issues, column: :issue_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :incident_management_timeline_events, column: :issue_id
+ end
+ end
+end
diff --git a/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb b/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb
new file mode 100644
index 00000000000..a35020699fc
--- /dev/null
+++ b/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToIncidentManagementTimelineEventsOnUpdatedByUser < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :incident_management_timeline_events, :users, column: :updated_by_user_id, on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :incident_management_timeline_events, column: :updated_by_user_id
+ end
+ end
+end
diff --git a/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb b/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb
new file mode 100644
index 00000000000..a09409900f7
--- /dev/null
+++ b/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToIncidentManagementTimelineEventsOnNote < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :incident_management_timeline_events, :notes, column: :promoted_from_note_id, on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :incident_management_timeline_events, column: :promoted_from_note_id
+ end
+ end
+end
diff --git a/db/schema_migrations/20211115132613 b/db/schema_migrations/20211115132613
new file mode 100644
index 00000000000..be6f19bdc70
--- /dev/null
+++ b/db/schema_migrations/20211115132613
@@ -0,0 +1 @@
+a9cc7d1fc3317958ecda959b62b42f93b2609c4e784566f9696fef51c5ebdf3b \ No newline at end of file
diff --git a/db/schema_migrations/20211115142803 b/db/schema_migrations/20211115142803
new file mode 100644
index 00000000000..0e9022f7c0e
--- /dev/null
+++ b/db/schema_migrations/20211115142803
@@ -0,0 +1 @@
+52fd12693481ae7e08eb084ef679434592538d99117c1906f30ca6a36b12a212 \ No newline at end of file
diff --git a/db/schema_migrations/20211115142847 b/db/schema_migrations/20211115142847
new file mode 100644
index 00000000000..049efcf8bcf
--- /dev/null
+++ b/db/schema_migrations/20211115142847
@@ -0,0 +1 @@
+cded37f94d578a503e5b389e6483ec68666983f71395c13b4f0011db04e807c3 \ No newline at end of file
diff --git a/db/schema_migrations/20211115142911 b/db/schema_migrations/20211115142911
new file mode 100644
index 00000000000..43bae5192c5
--- /dev/null
+++ b/db/schema_migrations/20211115142911
@@ -0,0 +1 @@
+63141e62fc21cf0a4b47355ecd3814c1f0cc829b7f4851d833f95369206c8919 \ No newline at end of file
diff --git a/db/schema_migrations/20211116093739 b/db/schema_migrations/20211116093739
new file mode 100644
index 00000000000..b0ded3f2a0f
--- /dev/null
+++ b/db/schema_migrations/20211116093739
@@ -0,0 +1 @@
+39d1988fe409944877df24e9859b171eab13c4a4703c8e85a2bff33318fb61fc \ No newline at end of file
diff --git a/db/schema_migrations/20211130151724 b/db/schema_migrations/20211130151724
new file mode 100644
index 00000000000..090d49ca482
--- /dev/null
+++ b/db/schema_migrations/20211130151724
@@ -0,0 +1 @@
+f9bd521c92558ba9ad3cfa3fd6ff1a647847c0fc767e1e4f45b43422542d5cc7 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 3cb591e3b52..79935490be0 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -15109,6 +15109,35 @@ CREATE SEQUENCE incident_management_pending_issue_escalations_id_seq
ALTER SEQUENCE incident_management_pending_issue_escalations_id_seq OWNED BY incident_management_pending_issue_escalations.id;
+CREATE TABLE incident_management_timeline_events (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ occurred_at timestamp with time zone NOT NULL,
+ project_id bigint NOT NULL,
+ author_id bigint,
+ issue_id bigint NOT NULL,
+ updated_by_user_id bigint,
+ promoted_from_note_id bigint,
+ cached_markdown_version integer,
+ editable boolean DEFAULT false NOT NULL,
+ note text NOT NULL,
+ note_html text NOT NULL,
+ action text NOT NULL,
+ CONSTRAINT check_18fd072206 CHECK ((char_length(action) <= 128)),
+ CONSTRAINT check_3875ed0aac CHECK ((char_length(note) <= 10000)),
+ CONSTRAINT check_94a235d6a4 CHECK ((char_length(note_html) <= 10000))
+);
+
+CREATE SEQUENCE incident_management_timeline_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_timeline_events_id_seq OWNED BY incident_management_timeline_events.id;
+
CREATE TABLE index_statuses (
id integer NOT NULL,
project_id integer NOT NULL,
@@ -21600,6 +21629,8 @@ ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id S
ALTER TABLE ONLY incident_management_pending_issue_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass);
+ALTER TABLE ONLY incident_management_timeline_events ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_events_id_seq'::regclass);
+
ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass);
ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass);
@@ -23268,6 +23299,9 @@ ALTER TABLE ONLY incident_management_pending_alert_escalations
ALTER TABLE ONLY incident_management_pending_issue_escalations
ADD CONSTRAINT incident_management_pending_issue_escalations_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT incident_management_timeline_events_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY index_statuses
ADD CONSTRAINT index_statuses_pkey PRIMARY KEY (id);
@@ -26139,6 +26173,16 @@ CREATE INDEX index_im_issuable_escalation_statuses_on_policy_id ON incident_mana
CREATE UNIQUE INDEX index_im_oncall_schedules_on_project_id_and_iid ON incident_management_oncall_schedules USING btree (project_id, iid);
+CREATE INDEX index_im_timeline_events_author_id ON incident_management_timeline_events USING btree (author_id);
+
+CREATE INDEX index_im_timeline_events_issue_id ON incident_management_timeline_events USING btree (issue_id);
+
+CREATE INDEX index_im_timeline_events_project_id ON incident_management_timeline_events USING btree (project_id);
+
+CREATE INDEX index_im_timeline_events_promoted_from_note_id ON incident_management_timeline_events USING btree (promoted_from_note_id);
+
+CREATE INDEX index_im_timeline_events_updated_by_user_id ON incident_management_timeline_events USING btree (updated_by_user_id);
+
CREATE UNIQUE INDEX index_import_export_uploads_on_group_id ON import_export_uploads USING btree (group_id) WHERE (group_id IS NOT NULL);
CREATE INDEX index_import_export_uploads_on_project_id ON import_export_uploads USING btree (project_id);
@@ -28874,6 +28918,12 @@ ALTER TABLE ONLY internal_ids
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_176d3fbb5d FOREIGN KEY (job_artifact_deleted_event_id) REFERENCES geo_job_artifact_deleted_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_17a5fafbd4 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_1800597ef9 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY project_features
ADD CONSTRAINT fk_18513d9b92 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -28994,6 +29044,9 @@ ALTER TABLE ONLY sprints
ALTER TABLE ONLY push_event_payloads
ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_38a74279df FOREIGN KEY (updated_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY bulk_import_exports
ADD CONSTRAINT fk_39c726d3b5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29021,6 +29074,9 @@ ALTER TABLE ONLY geo_event_log
ALTER TABLE ONLY remote_mirrors
ADD CONSTRAINT fk_43a9aa4ca8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_4432fc4d78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_runner_projects
ADD CONSTRAINT fk_4478a6f1e4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29504,6 +29560,9 @@ ALTER TABLE ONLY ci_sources_pipelines
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_d5af95fcd9 FOREIGN KEY (lfs_object_deleted_event_id) REFERENCES geo_lfs_object_deleted_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_d606a2a890 FOREIGN KEY (promoted_from_note_id) REFERENCES notes(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;