diff options
Diffstat (limited to 'db/migrate/20230509085428_change_organizations_sequence.rb')
-rw-r--r-- | db/migrate/20230509085428_change_organizations_sequence.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20230509085428_change_organizations_sequence.rb b/db/migrate/20230509085428_change_organizations_sequence.rb new file mode 100644 index 00000000000..59ec8c6e1ea --- /dev/null +++ b/db/migrate/20230509085428_change_organizations_sequence.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class ChangeOrganizationsSequence < Gitlab::Database::Migration[2.1] + def up + # Modify sequence for organizations.id so id '1' is never automatically taken + execute "ALTER SEQUENCE organizations_id_seq START WITH 1000 MINVALUE 1000 RESTART" + end + + def down + execute "ALTER SEQUENCE organizations_id_seq START WITH 1 MINVALUE 1" + end +end |