camper/test/booking_invoice.sql

40 lines
1.4 KiB
MySQL
Raw Normal View History

-- Test booking_invoice
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;
begin;
select plan(19);
set search_path to camper, public;
select has_table('booking_invoice');
select has_pk('booking_invoice');
select col_is_pk('booking_invoice', array['booking_id', 'invoice_id']);
select table_privs_are('booking_invoice', 'guest', array[]::text[]);
select table_privs_are('booking_invoice', 'employee', array['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('booking_invoice', 'admin', array['SELECT', 'INSERT', 'UPDATE', 'DELETE']);
select table_privs_are('booking_invoice', 'authenticator', array[]::text[]);
select has_column('booking_invoice', 'booking_id');
select col_is_fk('booking_invoice', 'booking_id');
select fk_ok('booking_invoice', 'booking_id', 'booking', 'booking_id');
select col_type_is('booking_invoice', 'booking_id', 'integer');
select col_not_null('booking_invoice', 'booking_id');
select col_hasnt_default('booking_invoice', 'booking_id');
select has_column('booking_invoice', 'invoice_id');
select col_is_fk('booking_invoice', 'invoice_id');
select fk_ok('booking_invoice', 'invoice_id', 'invoice', 'invoice_id');
select col_type_is('booking_invoice', 'invoice_id', 'integer');
select col_not_null('booking_invoice', 'invoice_id');
select col_hasnt_default('booking_invoice', 'invoice_id');
select *
from finish();
rollback;