BEGIN; SELECT plan(5); SELECT has_table('drafts'); SELECT columns_are('drafts', ARRAY[ 'draft_id', 'season_id', 'draft_status_id', 'name', 'account_id', 'started_at', 'modified_at', 'created_at']); SELECT has_sequence('drafts_draft_id_seq'); SELECT has_index('teamdraft', 'drafts', 'drafts_pk', 'draft_id'); INSERT INTO seasons (league_id, started_at, ended_at) VALUES (1, now() - interval '1 day', now() + interval '3 months') RETURNING season_id new_season_id \gset SELECT create_draft(1, 'sadbeast', 'freckles', now() + interval '3 days') new_session_id \gset SELECT is(1, (SELECT count(1)::int FROM account_active_session_keys WHERE session_id = :'new_session_id')); SELECT * FROM finish(); ROLLBACK;