numerus/deploy/company_default_payment_method.sql
jordi fita mas 31ef3ea47a Add company’s default payment method
I had to use a deferrable foreign key because the payment methods have
a reference to the company, and the company now a circular reference to
payment method.
2023-03-04 22:15:52 +01:00

14 lines
299 B
PL/PgSQL

-- Deploy numerus:company_default_payment_method to pg
-- requires: schema_numerus
-- requires: company
-- requires: payment_method
begin;
set search_path to numerus, public;
alter table company
add column default_payment_method_id integer not null references payment_method deferrable;
commit;