38 lines
1.1 KiB
PL/PgSQL
38 lines
1.1 KiB
PL/PgSQL
-- Test company_host
|
|
set client_min_messages to warning;
|
|
create extension if not exists pgtap;
|
|
reset client_min_messages;
|
|
|
|
begin;
|
|
|
|
select plan(17);
|
|
|
|
set search_path to camper, public;
|
|
|
|
select has_table('company_host');
|
|
select has_pk('company_host' );
|
|
select table_privs_are('company_host', 'guest', array ['SELECT']);
|
|
select table_privs_are('company_host', 'employee', array ['SELECT']);
|
|
select table_privs_are('company_host', 'admin', array ['SELECT']);
|
|
select table_privs_are('company_host', 'authenticator', array []::text[]);
|
|
|
|
select has_column('company_host', 'host');
|
|
select col_is_pk('company_host', 'host');
|
|
select col_type_is('company_host', 'host', 'text');
|
|
select col_not_null('company_host', 'host');
|
|
select col_hasnt_default('company_host', 'host');
|
|
|
|
select has_column('company_host', 'company_id');
|
|
select col_is_fk('company_host', 'company_id');
|
|
select fk_ok('company_host', 'company_id', 'company', 'company_id');
|
|
select col_type_is('company_host', 'company_id', 'integer');
|
|
select col_not_null('company_host', 'company_id');
|
|
select col_hasnt_default('company_host', 'company_id');
|
|
|
|
|
|
select *
|
|
from finish();
|
|
|
|
rollback;
|
|
|