76 lines
4.2 KiB
PHP
76 lines
4.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
$SQL = "CREATE TABLE voters (
|
||
|
|
|
||
|
|
voter_serial serial,
|
||
|
|
|
||
|
|
-- Core Identifiers
|
||
|
|
voter_county_code char(3) NOT null,
|
||
|
|
voter_id char(10) NOT null,
|
||
|
|
|
||
|
|
-- Name
|
||
|
|
voter_name_last varchar(30) null,
|
||
|
|
voter_name_suffix varchar(5) null,
|
||
|
|
voter_name_first varchar(30) null,
|
||
|
|
voter_name_middle varchar(30) null,
|
||
|
|
|
||
|
|
-- Public Records Exemption
|
||
|
|
voter_public_records_exempt char(1) null,
|
||
|
|
|
||
|
|
-- Residence Address
|
||
|
|
voter_residence_address_1 varchar(50) null,
|
||
|
|
voter_residence_address_2 varchar(40) null,
|
||
|
|
voter_residence_city varchar(40) null,
|
||
|
|
voter_residence_state char(2) null,
|
||
|
|
voter_residence_zipcode varchar(10) null,
|
||
|
|
|
||
|
|
-- Mailing Address
|
||
|
|
voter_mailing_address_1 varchar(40) null,
|
||
|
|
voter_mailing_address_2 varchar(40) null,
|
||
|
|
voter_mailing_address_3 varchar(40) null,
|
||
|
|
voter_mailing_city varchar(40) null,
|
||
|
|
voter_mailing_state char(2) null,
|
||
|
|
voter_mailing_zipcode varchar(12) null,
|
||
|
|
voter_mailing_country varchar(40) null,
|
||
|
|
|
||
|
|
-- Demographics
|
||
|
|
voter_gender char(1) null,
|
||
|
|
voter_race char(1) null,
|
||
|
|
|
||
|
|
-- Dates
|
||
|
|
voter_birth_date DATE null,
|
||
|
|
voter_registration_date DATE null,
|
||
|
|
|
||
|
|
-- Voting Info
|
||
|
|
voter_party_affiliation char(3) null,
|
||
|
|
voter_precinct char(6) null,
|
||
|
|
voter_precinct_group char(3) null,
|
||
|
|
voter_precinct_split char(6) null,
|
||
|
|
voter_precinct_suffix char(3) null,
|
||
|
|
voter_voter_status char(3) null,
|
||
|
|
|
||
|
|
-- Districts
|
||
|
|
voter_congressional_district char(3) null,
|
||
|
|
voter_house_district char(3) null,
|
||
|
|
voter_senate_district char(3) null,
|
||
|
|
voter_county_commission_district char(3) null,
|
||
|
|
voter_school_board_district char(2) null,
|
||
|
|
|
||
|
|
-- Contact (Protected)
|
||
|
|
voter_daytime_area_code char(3) null,
|
||
|
|
voter_daytime_phone_number char(7) null,
|
||
|
|
voter_daytime_phone_extension char(4) null,
|
||
|
|
voter_email_address varchar(100) null,
|
||
|
|
|
||
|
|
-- Metadata
|
||
|
|
voter_record_created datetime default current_timestamp,
|
||
|
|
|
||
|
|
PRIMARY KEY (voter_serial),
|
||
|
|
UNIQUE KEY uq_voter (voter_county_code, voter_id),
|
||
|
|
KEY idx_last_name (voter_name_last),
|
||
|
|
KEY idx_precinct (voter_precinct),
|
||
|
|
KEY idx_status (voter_voter_status)
|
||
|
|
|
||
|
|
) ENGINE=InnoDB DEFAULT charSET=utf8mb4";
|
||
|
|
?>
|