<?php

$SQL = "create table permits (

          permit_serial              serial,
          permit_permit_facts_id     bigint unsigned                 default 0,
          permit_entry_date_str      varchar(12)                     default '',
          permit_entry_date          date                  not null  default 0,
          permit_permit_number       varchar(50)                     default '', 
          permit_permit_date_str     varchar(12)                     default '',
          permit_permit_date         date                            default null,
          
          permit_project_addr        varchar(100)                    default '',
          permit_sub_div_name        varchar(100)                    default '',
          permit_project_type        varchar(100)                    default '',
          
          permit_company             varchar(100)                    default '',
          permit_address             varchar(100)                    default null,
          permit_city                varchar(100)                    default null,
          permit_state               varchar(2)                      default null,
          permit_zip                 varchar(10)                     default null,
          permit_phone               varchar(14)                     default null,
          permit_project_city        varchar(100)                    default '',
          permit_project_state       varchar(2)                      default '',
          permit_size                int(11)                         default null,
          permit_units               int(11)                         default 0,
          permit_building_type       int(11)                         default 0,
          permit_value               int(11)                         default 0,
          permit_work_type           int(11)                         default 0,
          permit_county              varchar(100)                    default 0,
          permit_lot                 varchar(7)                      default null,
          permit_dist_ll             varchar(7)                      default null,
          permit_ct1                 tinyint(1)                      default 0,
          
          permit_owner_name          varchar(100)                    default null,
          permit_owner_address       varchar(100)                    default null,
          permit_owner_city          varchar(100)                    default null,
          permit_owner_state         varchar(2)                      default null,
          permit_owner_zip           varchar(10)                     default null,
          permit_owner_phone         varchar(14)                     default null,
          
          permit_ytd_permits         int(11)                         default 0,
          permit_ytd_value           int(11)                         default 0,
          permit_12mth_prev_permits  int(11)                         default 0,
          
          permit_creator             varchar(100)                    default null,
          permit_created             datetime                        default null,
          permit_changer             varchar(100)                    default null,
          permit_changed             datetime                        default null,
          
          primary key (permit_serial)
        )

        default character set = utf8";
?>