mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* 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
23 lines
1.5 KiB
SQL
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); |