camper/deploy/payment_customer.sql

30 lines
787 B
PL/PgSQL

-- Deploy camper:payment_customer to pg
-- requires: roles
-- requires: schema_camper
-- requires: payment
-- requires: country
-- requires: country_code
-- requires: extension_pg_libphonenumber
begin;
set search_path to camper, public;
create table payment_customer (
payment_id integer not null primary key references payment,
full_name text not null,
address text not null,
postal_code text not null,
city text not null,
country_code country_code not null references country,
email email not null,
phone packed_phone_number not null,
acsi_card boolean not null
);
grant select, insert on table payment_customer to guest;
grant select, insert, update on table payment_customer to employee;
grant select, insert, update, delete on table payment_customer to admin;
commit;