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-10 21:10:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-10 21:10:50 +0300
commitf27a1b0faf16a83ba9c3f71f660262e368f4509a (patch)
treef87277526b25da417b30a425c51bbd81eff6639b /db
parentae1b3d982482280f22a907faba2c9ba02f4d1db1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb16
-rw-r--r--db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb16
-rw-r--r--db/schema_migrations/202302010142231
-rw-r--r--db/schema_migrations/202302010142381
-rw-r--r--db/structure.sql14
5 files changed, 47 insertions, 1 deletions
diff --git a/db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb b/db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb
new file mode 100644
index 00000000000..ec84f1cb946
--- /dev/null
+++ b/db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfSystemNoteMetadataNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :system_note_metadata
+ 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/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb b/db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..df24b755b7f
--- /dev/null
+++ b/db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillSystemNoteMetadataNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :system_note_metadata
+ 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/20230201014223 b/db/schema_migrations/20230201014223
new file mode 100644
index 00000000000..323fe555df5
--- /dev/null
+++ b/db/schema_migrations/20230201014223
@@ -0,0 +1 @@
+42100a86045f084c3b74e404a2f95d4d76751ad92102edb271dc628279060ce5 \ No newline at end of file
diff --git a/db/schema_migrations/20230201014238 b/db/schema_migrations/20230201014238
new file mode 100644
index 00000000000..8a2d6effa5e
--- /dev/null
+++ b/db/schema_migrations/20230201014238
@@ -0,0 +1 @@
+00bbfdf3e45248b72aac115e44a95c23b71344dcc9e35ad3be6bf1f5eda33561 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 5a937446086..de5030325f9 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -297,6 +297,15 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION trigger_c5a5f48f12b0() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -22359,7 +22368,8 @@ CREATE TABLE system_note_metadata (
action character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
- description_version_id bigint
+ description_version_id bigint,
+ note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE system_note_metadata_id_seq
@@ -33581,6 +33591,8 @@ CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_ment
CREATE TRIGGER trigger_c2051020aa8b BEFORE INSERT OR UPDATE ON issue_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c2051020aa8b();
+CREATE TRIGGER trigger_482bac5ec48a BEFORE INSERT OR UPDATE ON system_note_metadata FOR EACH ROW EXECUTE FUNCTION trigger_482bac5ec48a();
+
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();