Auto-increment external_account_id automatically by default to allow upcoming simple signups

This commit is contained in:
Jorge Manrubia
2025-11-27 10:56:55 +01:00
parent e77858fb3c
commit 07b4c55185
4 changed files with 44 additions and 0 deletions
@@ -0,0 +1,15 @@
class CreateExternalAccounts < ActiveRecord::Migration[8.0]
def up
create_table :external_accounts do |t|
end
max_id = Account.maximum(:external_account_id) || 0
if max_id > 0
execute "INSERT INTO external_accounts (id) VALUES (#{max_id})"
end
end
def down
drop_table :external_accounts
end
end