diff options
Diffstat (limited to 'db/migrate/20230927124202_add_mastodon_to_user_details.rb')
-rw-r--r-- | db/migrate/20230927124202_add_mastodon_to_user_details.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20230927124202_add_mastodon_to_user_details.rb b/db/migrate/20230927124202_add_mastodon_to_user_details.rb new file mode 100644 index 00000000000..a1aa099087b --- /dev/null +++ b/db/migrate/20230927124202_add_mastodon_to_user_details.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddMastodonToUserDetails < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + USER_DETAILS_FIELD_LIMIT = 500 + + def up + with_lock_retries do + add_column :user_details, :mastodon, :text, default: '', null: false, if_not_exists: true + end + + add_text_limit :user_details, :mastodon, USER_DETAILS_FIELD_LIMIT + end + + def down + with_lock_retries do + remove_column :user_details, :mastodon + end + end +end |