Files
payments/internal/storage/migrations/21-psu-connection-payments-accounts.sql
fgueryandGitHub 43e4a51551 fix: make nonblocking migration (#555)
* feat: quick&dirty DB inserter to payment table

* fix: replace migration 21 with lock less migration

* fix: fix continuous-writer to properly create connector

* fix: added validate at the end of the migration

* chore: enable couple of IDE language injection rules

* chore: linting

* fix: guard against txn in migration, refactor conitnuous-writer a bit

* chore: linting
2025-09-24 13:12:26 +00:00

23 lines
1.5 KiB
SQL

-- THIS IS NOT USED ANYMORE, keeping it as some envs have ran it (see migrations.go)
-- alter table payments add column if not exists psu_id uuid;
-- alter table payments add constraint payments_psu_id_fk foreign key (psu_id) references payment_service_users (id) on delete cascade;
--
-- alter table payments add column if not exists open_banking_connection_id varchar;
-- alter table payments add constraint payments_open_banking_connection_id_fk foreign key (psu_id, connector_id, open_banking_connection_id) references psu_bank_bridge_connections (psu_id, connector_id, connection_id) on delete cascade;
--
-- create index if not exists payments_psu_id_idx
-- on payments (psu_id);
-- create index if not exists payments_psu_conn_obc_idx
-- on payments (psu_id, connector_id, open_banking_connection_id);
--
-- alter table accounts add column if not exists psu_id uuid;
-- alter table accounts add constraint accounts_psu_id_fk foreign key (psu_id) references payment_service_users (id) on delete cascade;
--
-- alter table accounts add column if not exists open_banking_connection_id varchar;
-- alter table accounts add constraint accounts_open_banking_connection_id_fk foreign key (psu_id, connector_id, open_banking_connection_id) references psu_bank_bridge_connections (psu_id, connector_id, connection_id) on delete cascade;
--
-- create index if not exists accounts_psu_id_idx
-- on accounts (psu_id);
-- create index if not exists accounts_psu_conn_obc_idx
-- on accounts (psu_id, connector_id, open_banking_connection_id);