<?php

$SQL = "create table permitfacts

        (

          permitfact_serial             serial,
          permitfact_legacy_id          bigint unsigned    default null,
          permitfact_entry_date         date               default null,
          permitfact_permit_number      varchar(100)       default null,
          permitfact_permit_date        date               default null,
          permitfact_county             bigint unsigned    default null, /* counties table */
          
          permitfact_project_address    varchar(254)       default null,
          permitfact_project_name       varchar(100)       default null,
          permitfact_project_type       bigint unsigned    default null, /* dropdowns table */
          permitfact_project_city       bigint unsigned    default null, /* cities table */
          permitfact_project_state      varchar(2)         default null,
          permitfact_project_zip        varchar(20)        default null,
          
          permitfact_company            varchar(100)       default null,
          permitfact_address            varchar(100)       default null,
          permitfact_city               bigint unsigned    default null, /* cities table */
          permitfact_state              varchar(2)         default null,
          permitfact_zip                varchar(20)        default null,
          permitfact_phone              varchar(10)        default null,
          permitfact_size               bigint unsigned    default null,
          permitfact_value              decimal(15,2)       default null,
          
          permitfact_work_type          bigint unsigned    default null, /* dropdowns table */
          permitfact_building_type      bigint unsigned    default null, /* dropdowns table */
          permitfact_lot_block          varchar(100)       default null,
          permitfact_dist_ll            varchar(100)       default null,
          
          permitfact_owner_name         varchar(100)       default null,
          permitfact_owner_address      varchar(254)       default null,
          permitfact_owner_city         bigint unsigned    default null, /* cities table */
          permitfact_owner_state        varchar(2)         default null,
          permitfact_owner_zip          varchar(20)        default null,
          permitfact_owner_phone        varchar(10)        default null,
          
          permitfact_creator         varchar(100)    default null,
          permitfact_created         datetime        default null,
          permitfact_changer         varchar(100)    default null,
          permitfact_changed         datetime        default null,
          
          primary key (permitfact_serial)
          
        )

        default character set = utf8";
?>
