summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20221128155738_add_discord_to_user_details.rb12
-rw-r--r--db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb15
-rw-r--r--db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb24
-rw-r--r--db/schema_migrations/202211281557381
-rw-r--r--db/schema_migrations/202211281658331
-rw-r--r--db/structure.sql2
6 files changed, 35 insertions, 20 deletions
diff --git a/db/migrate/20221128155738_add_discord_to_user_details.rb b/db/migrate/20221128155738_add_discord_to_user_details.rb
new file mode 100644
index 00000000000..4d59a53dcd7
--- /dev/null
+++ b/db/migrate/20221128155738_add_discord_to_user_details.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AddDiscordToUserDetails < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limits are added in 20221128165833_add_discord_field_limit_to_user_details.rb
+ def change
+ add_column :user_details, :discord, :text, default: '', null: false
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb b/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb
new file mode 100644
index 00000000000..a63b2019b20
--- /dev/null
+++ b/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddDiscordFieldLimitToUserDetails < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ USER_DETAILS_FIELD_LIMIT = 500
+
+ def up
+ add_text_limit :user_details, :discord, USER_DETAILS_FIELD_LIMIT
+ end
+
+ def down
+ remove_text_limit :user_details, :discord
+ end
+end
diff --git a/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb b/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb
index f98be3f036f..d409a4dfdd1 100644
--- a/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb
+++ b/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb
@@ -3,29 +3,13 @@
class SanitizeConfidentialNoteTodos < Gitlab::Database::Migration[2.0]
restrict_gitlab_migration gitlab_schema: :gitlab_main
- MIGRATION = 'SanitizeConfidentialTodos'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 200
- MAX_BATCH_SIZE = 1000
- SUB_BATCH_SIZE = 20
-
- disable_ddl_transaction!
- restrict_gitlab_migration gitlab_schema: :gitlab_main
-
def up
- queue_batched_background_migration(
- MIGRATION,
- :notes,
- :id,
- job_interval: DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE,
- gitlab_schema: :gitlab_main
- )
+ # no-op: this empty migration is left here only for compatibility reasons.
+ # It was a temporary migration which used not-isolated code.
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/382557
end
def down
- delete_batched_background_migration(MIGRATION, :notes, :id, [])
+ # no-op
end
end
diff --git a/db/schema_migrations/20221128155738 b/db/schema_migrations/20221128155738
new file mode 100644
index 00000000000..5322aa1f75e
--- /dev/null
+++ b/db/schema_migrations/20221128155738
@@ -0,0 +1 @@
+39ca72ad461ff7b56ce6feed351ef46ee9f3584a8c3c9383ca75f44b61baa1a1 \ No newline at end of file
diff --git a/db/schema_migrations/20221128165833 b/db/schema_migrations/20221128165833
new file mode 100644
index 00000000000..e2aeaa26c32
--- /dev/null
+++ b/db/schema_migrations/20221128165833
@@ -0,0 +1 @@
+4f4846fe8e5f84ee566dfc8f9b8249e1ff1d77f8f6c2f0006d89a73a2e734b9d \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 4595145cbc7..aa0a4f486ca 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -22714,9 +22714,11 @@ CREATE TABLE user_details (
organization text DEFAULT ''::text NOT NULL,
password_last_changed_at timestamp with time zone DEFAULT now() NOT NULL,
onboarding_step_url text,
+ discord text DEFAULT ''::text NOT NULL,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
CONSTRAINT check_444573ee52 CHECK ((char_length(skype) <= 500)),
CONSTRAINT check_466a25be35 CHECK ((char_length(twitter) <= 500)),
+ CONSTRAINT check_4ef1de1a15 CHECK ((char_length(discord) <= 500)),
CONSTRAINT check_4f51129940 CHECK ((char_length(onboarding_step_url) <= 2000)),
CONSTRAINT check_7b246dad73 CHECK ((char_length(organization) <= 500)),
CONSTRAINT check_7d6489f8f3 CHECK ((char_length(linkedin) <= 500)),