whos_your_daddy_common 0.2.0

Common source code for the Who's Your Daddy projects, like the Enumerator and Presenter.
Documentation
db:
- admin_user: postgres
  admin_password: agamemnon
  host: localhost
  name: usa
  port: 5432
  enums:
  - CREATE TYPE branch AS ENUM ('Unknown', 'Executive', 'Legislative', 'Judicial');
  - CREATE TYPE governmentlevel AS ENUM ('Unknown', 'SpecialDistrict', 'Municipal', 'County', 'State', 'Federal', 'International', 'Global', 'Interplanetary');
  domains:
  - "CREATE DOMAIN branch_notnull AS branch NOT NULL;"
  - "CREATE DOMAIN date_notnull AS date NOT NULL;"
  - "CREATE DOMAIN varchar_50_notnull AS varchar(50) NOT NULL;"
  - "CREATE DOMAIN varchar_100_notnull AS varchar(100) NOT NULL;"
  - "CREATE DOMAIN text_notnull AS text NOT NULL;"
  - "CREATE DOMAIN text_array_notnull AS text[] CONSTRAINT array_not_null CHECK (VALUE IS NOT NULL) CONSTRAINT elements_not_null CHECK (array_position(VALUE, NULL) IS NULL);"
  - "CREATE DOMAIN governmentlevel_notnull AS governmentlevel NOT NULL;"
  tables:
  - name: legislation
    columns:
    - introduction_date date NOT NULL
    - title text NOT NULL
  - name: officials
    columns:
    - birth date NOT NULL
    - birth_country text
    - birth_country_sources text[] NOT NULL check (array_position(birth_country_sources, null) is null)
    - birth_sources text[] NOT NULL check (array_position(birth_sources, null) is null)
    - first_name varchar(30) NOT NULL
    - first_name_sources text[] NOT NULL check (array_position(first_name_sources, null) is null)
    - id UUID PRIMARY KEY
    - is_in_office bool NOT NULL
    - last_name varchar(30) NOT NULL
    - last_name_sources text[] NOT NULL check (array_position(last_name_sources, null) is null)
    - middle_name varchar(30)
    - middle_name_sources text[] NOT NULL check (array_position(middle_name_sources, null) is null)
  - name: terms
    columns:
    - branch branch_notnull NOT NULL
    - branch_sources text[] NOT NULL check (array_position(branch_sources, null) is null)
    - end_date date
    - end_date_sources text[] NOT NULL check (array_position(end_date_sources, null) is null)
    - id UUID PRIMARY KEY
    - level governmentlevel_notnull NOT NULL
    - level_sources text[] NOT NULL check (array_position(level_sources, null) is null)
    - location text NOT NULL
    - location_sources text[] NOT NULL check (array_position(location_sources, null) is null)
    - office_title varchar(100) NOT NULL
    - office_title_sources text[] NOT NULL check (array_position(office_title_sources, null) is null)
    - parent_id UUID NOT NULL REFERENCES officials(id) ON DELETE CASCADE
    - political_party varchar(50) NOT NULL
    - political_party_sources text[] NOT NULL check (array_position(political_party_sources, null) is null)
    - session_number integer
    - session_number_sources text[] NOT NULL check (array_position(session_number_sources, null) is null)
    - start_date date NOT NULL
    - start_date_sources text[] NOT NULL check (array_position(start_date_sources, null) is null)
  - name: posts
    columns:
    - account_name varchar(50) NOT NULL
    - content text NOT NULL
    - last_update_at timestamp with time zone
    - parent_id UUID NOT NULL REFERENCES officials(id) ON DELETE CASCADE
    - publish_date timestamp with time zone NOT NULL
    - url text NOT NULL
  users:
  - username: reader
    password: reader
    role: readonly