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>2023-02-03 15:09:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-03 15:09:13 +0300
commit83916cf0a2f9254455a08a723961db34f0840df4 (patch)
tree41995d4ec0210785de1cd71853cbd1380570b2e7 /db
parenta9c5941625be2416fbf3b514019886e8f9658416 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/schema_migrations/202302020026161
-rw-r--r--db/schema_migrations/202302020026371
-rw-r--r--db/structure.sql14
5 files changed, 47 insertions, 1 deletions
diff --git a/db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb b/db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..8e0c4e0b106
--- /dev/null
+++ b/db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfEpicUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :epic_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ def up
+ initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..1f7af1af78f
--- /dev/null
+++ b/db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillEpicUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :epic_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/schema_migrations/20230202002616 b/db/schema_migrations/20230202002616
new file mode 100644
index 00000000000..dc441296f20
--- /dev/null
+++ b/db/schema_migrations/20230202002616
@@ -0,0 +1 @@
+b78e2581507a85f6ba72f1a6636fb6e8fe372fc8a4accf8f954d25e1ee8c6dc8 \ No newline at end of file
diff --git a/db/schema_migrations/20230202002637 b/db/schema_migrations/20230202002637
new file mode 100644
index 00000000000..8ada17cb13b
--- /dev/null
+++ b/db/schema_migrations/20230202002637
@@ -0,0 +1 @@
+67ce816b0b7e4055f4ffcbfaf407fc56c655f907863528697c83d0f718f9ae21 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index ddc4945a58f..4595145cbc7 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -234,6 +234,15 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_c5a5f48f12b0() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION trigger_c7107f30d69d() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -15433,7 +15442,8 @@ CREATE TABLE epic_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE epic_user_mentions_id_seq
@@ -33438,6 +33448,8 @@ CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OL
CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd();
+CREATE TRIGGER trigger_c5a5f48f12b0 BEFORE INSERT OR UPDATE ON epic_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c5a5f48f12b0();
+
CREATE TRIGGER trigger_c7107f30d69d BEFORE INSERT OR UPDATE ON merge_request_metrics FOR EACH ROW EXECUTE FUNCTION trigger_c7107f30d69d();
CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace();