-- Create CEInspectors
CREATE TABLE `CEInspectors` ( `cei_number` INT NOT NULL,  `cei_name` VARCHAR(255) NOT NULL,  `cei_cc` INT NULL,  `cei_qei` VARCHAR(255) NULL,  `cei_sig` BLOB NULL,  `cei_last_sync` DATETIME NULL,  `cei_pda_version` VARCHAR(10) NULL ,PRIMARY KEY (`cei_number`), UNIQUE KEY `PRIMARY` (`cei_number`));
-- Create Clients
CREATE TABLE `Clients` ( `client_id` INT NULL AUTO_INCREMENT,  `client_name` VARCHAR(100) NULL,  `client_phone` VARCHAR(15) NULL,  `client_sig` BLOB NULL,  `client_title` VARCHAR(25) NULL,  `client_type` VARCHAR(35) NULL,  `client_email` VARCHAR(50) NULL,  `client_cei` INT NULL,  `client_cet` INT NULL ,PRIMARY KEY (`client_id`), UNIQUE KEY `PRIMARY` (`client_id`));
-- Create Customers
CREATE TABLE `Customers` ( `contact_name` VARCHAR(255) NOT NULL,  `company` VARCHAR(255) NOT NULL,  `email` VARCHAR(255) NOT NULL,  `phone` VARCHAR(255) NULL,  `building_name` VARCHAR(255) NULL,  `address` VARCHAR(255) NULL,  `city` VARCHAR(255) NULL,  `state` VARCHAR(255) NULL,  `zip` VARCHAR(255) NULL,  `county` VARCHAR(255) NULL,  `bill_to` VARCHAR(255) NULL,  `customer_id` INT NULL AUTO_INCREMENT,  `password` VARCHAR(50) NOT NULL,  `last_active` DATETIME NULL ,PRIMARY KEY (`customer_id`), UNIQUE KEY `PRIMARY` (`customer_id`));
-- Create CustomersInspections
CREATE TABLE `CustomersInspections` ( `customer_id` INT NULL,  `inspection_id` INT NULL);
-- Create evcategories
CREATE TABLE `evcategories` ( `Category` VARCHAR(50) NULL);
-- Create evevents
CREATE TABLE `evevents` ( `Category` VARCHAR(50) NULL,  `Description` VARCHAR(2147483647) NULL,  `EventID` INT NULL AUTO_INCREMENT,  `FromDate` DATE NULL,  `FromTime` VARCHAR(50) NULL,  `Image` VARCHAR(50) NULL,  `Location` VARCHAR(50) NULL,  `Map` VARCHAR(2147483647) NULL,  `Note` VARCHAR(2147483647) NULL,  `Price` FLOAT NULL,  `Subject` VARCHAR(50) NULL,  `ToDate` DATE NULL,  `ToTime` VARCHAR(50) NULL ,PRIMARY KEY (`EventID`), UNIQUE KEY `PRIMARY` (`EventID`));
-- Create evtellfriend
CREATE TABLE `evtellfriend` ( `EmailAddress1` VARCHAR(50) NULL,  `EmailAddress2` VARCHAR(50) NULL,  `EmailAddress3` VARCHAR(50) NULL,  `EmailAddress4` VARCHAR(50) NULL,  `EmailAddress5` VARCHAR(50) NULL,  `EmailBody` VARCHAR(2147483647) NULL,  `EmailSubject` VARCHAR(50) NULL,  `FromName` VARCHAR(50) NULL);
-- Create evusers
CREATE TABLE `evusers` ( `Email` VARCHAR(50) NULL,  `Group` VARCHAR(50) NULL,  `ID` INT NULL AUTO_INCREMENT,  `Password` VARCHAR(50) NULL,  `Username` VARCHAR(50) NULL ,PRIMARY KEY (`ID`), UNIQUE KEY `PRIMARY` (`ID`));
-- Create Inspections
CREATE TABLE `Inspections` ( `work_order_number` VARCHAR(11) NOT NULL,  `serial_number` INT NOT NULL,  `inspection_date` VARCHAR(8) NOT NULL,  `type` VARCHAR(15) NOT NULL,  `v1` VARCHAR(5) NULL,  `v2` VARCHAR(5) NULL,  `v3` VARCHAR(5) NULL,  `v4` VARCHAR(5) NULL,  `v5` VARCHAR(5) NULL,  `v6` VARCHAR(5) NULL,  `v7` VARCHAR(5) NULL,  `v8` VARCHAR(5) NULL,  `v9` VARCHAR(5) NULL,  `cei_number` VARCHAR(4) NOT NULL,  `firekeys` VARCHAR(7) NOT NULL,  `alt_power_req` VARCHAR(7) NOT NULL,  `test_witness` VARCHAR(32) NOT NULL,  `hydro_capacity` VARCHAR(8) NULL,  `hydro_full_load_pressure` VARCHAR(7) NULL,  `hydro_relief_pressure` VARCHAR(7) NULL,  `hydro_drop` VARCHAR(10) NULL,  `v1_comments` VARCHAR(255) NULL,  `v2_comments` VARCHAR(255) NULL,  `v3_comments` VARCHAR(255) NULL,  `v4_comments` VARCHAR(255) NULL,  `v5_comments` VARCHAR(255) NULL,  `v6_comments` VARCHAR(255) NULL,  `v7_comments` VARCHAR(255) NULL,  `v8_comments` VARCHAR(255) NULL,  `v9_comments` VARCHAR(255) NULL,  `mileage` INT NOT NULL,  `hours` VARCHAR(10) NOT NULL,  `overtime` VARCHAR(10) NOT NULL,  `bill_to` VARCHAR(255) NULL,  `maintenance_company` VARCHAR(255) NULL,  `inspection_id` INT NULL AUTO_INCREMENT,  `client_name` VARCHAR(100) NULL,  `client_phone` VARCHAR(15) NULL,  `vs_corrected` VARCHAR(5) NULL,  `chapter_399` VARCHAR(5) NULL,  `date_stamp` DATE NULL,  `deleted` INT NULL,  `due_date` DATE NULL,  `annual_date` DATE NULL ,PRIMARY KEY (`inspection_id`), UNIQUE KEY `PRIMARY` (`inspection_id`));
-- Create Inspections_bak
CREATE TABLE `Inspections_bak` ( `work_order_number` VARCHAR(11) NOT NULL,  `serial_number` INT NOT NULL,  `inspection_date` VARCHAR(8) NOT NULL,  `type` VARCHAR(15) NOT NULL,  `v1` VARCHAR(5) NULL,  `v2` VARCHAR(5) NULL,  `v3` VARCHAR(5) NULL,  `v4` VARCHAR(5) NULL,  `v5` VARCHAR(5) NULL,  `v6` VARCHAR(5) NULL,  `v7` VARCHAR(5) NULL,  `v8` VARCHAR(5) NULL,  `v9` VARCHAR(5) NULL,  `cei_number` VARCHAR(4) NOT NULL,  `firekeys` VARCHAR(7) NOT NULL,  `alt_power_req` VARCHAR(7) NOT NULL,  `test_witness` VARCHAR(32) NOT NULL,  `hydro_capacity` VARCHAR(8) NULL,  `hydro_full_load_pressure` VARCHAR(7) NULL,  `hydro_relief_pressure` VARCHAR(7) NULL,  `hydro_drop` VARCHAR(10) NULL,  `v1_comments` VARCHAR(255) NULL,  `v2_comments` VARCHAR(255) NULL,  `v3_comments` VARCHAR(255) NULL,  `v4_comments` VARCHAR(255) NULL,  `v5_comments` VARCHAR(255) NULL,  `v6_comments` VARCHAR(255) NULL,  `v7_comments` VARCHAR(255) NULL,  `v8_comments` VARCHAR(255) NULL,  `v9_comments` VARCHAR(255) NULL,  `mileage` INT NOT NULL,  `hours` VARCHAR(10) NOT NULL,  `overtime` VARCHAR(10) NOT NULL,  `bill_to` VARCHAR(255) NULL,  `maintenance_company` VARCHAR(255) NULL,  `inspection_id` INT NULL AUTO_INCREMENT,  `client_name` VARCHAR(100) NULL,  `client_phone` VARCHAR(15) NULL,  `vs_corrected` VARCHAR(5) NULL,  `chapter_399` VARCHAR(5) NULL,  `date_stamp` DATE NULL,  `deleted` INT NULL,  `due_date` DATE NULL ,PRIMARY KEY (`inspection_id`), UNIQUE KEY `PRIMARY` (`inspection_id`));
-- Create Inspections_dev
CREATE TABLE `Inspections_dev` ( `work_order_number` VARCHAR(11) NOT NULL,  `serial_number` INT NOT NULL,  `inspection_date` VARCHAR(8) NOT NULL,  `type` VARCHAR(15) NOT NULL,  `v1` VARCHAR(5) NULL,  `v2` VARCHAR(5) NULL,  `v3` VARCHAR(5) NULL,  `v4` VARCHAR(5) NULL,  `v5` VARCHAR(5) NULL,  `v6` VARCHAR(5) NULL,  `v7` VARCHAR(5) NULL,  `v8` VARCHAR(5) NULL,  `v9` VARCHAR(5) NULL,  `cei_number` VARCHAR(4) NOT NULL,  `firekeys` VARCHAR(7) NOT NULL,  `alt_power_req` VARCHAR(7) NOT NULL,  `test_witness` VARCHAR(32) NOT NULL,  `hydro_capacity` VARCHAR(8) NULL,  `hydro_full_load_pressure` VARCHAR(7) NULL,  `hydro_relief_pressure` VARCHAR(7) NULL,  `hydro_drop` VARCHAR(10) NULL,  `v1_comments` VARCHAR(255) NULL,  `v2_comments` VARCHAR(255) NULL,  `v3_comments` VARCHAR(255) NULL,  `v4_comments` VARCHAR(255) NULL,  `v5_comments` VARCHAR(255) NULL,  `v6_comments` VARCHAR(255) NULL,  `v7_comments` VARCHAR(255) NULL,  `v8_comments` VARCHAR(255) NULL,  `v9_comments` VARCHAR(255) NULL,  `mileage` INT NOT NULL,  `hours` VARCHAR(10) NOT NULL,  `overtime` VARCHAR(10) NOT NULL,  `bill_to` VARCHAR(255) NULL,  `maintenance_company` VARCHAR(255) NULL,  `inspection_id` INT NULL AUTO_INCREMENT,  `client_name` VARCHAR(100) NULL,  `client_phone` VARCHAR(15) NULL,  `vs_corrected` VARCHAR(5) NULL,  `chapter_399` VARCHAR(5) NULL,  `date_stamp` DATE NULL,  `deleted` INT NULL,  `due_date` DATE NULL ,PRIMARY KEY (`inspection_id`), UNIQUE KEY `PRIMARY` (`inspection_id`));
-- Create InspectionTypes
CREATE TABLE `InspectionTypes` ( `code` VARCHAR(15) NOT NULL,  `type` VARCHAR(50) NULL ,PRIMARY KEY (`code`), UNIQUE KEY `PRIMARY` (`code`));
-- Create MaintCos
CREATE TABLE `MaintCos` ( `company` VARCHAR(255) NULL,  `fax_number` VARCHAR(255) NULL,  `email` VARCHAR(255) NULL,  `id` INT NULL AUTO_INCREMENT ,PRIMARY KEY (`id`), UNIQUE KEY `PRIMARY` (`id`));
-- Create NewInspections
CREATE TABLE `NewInspections` ( `inspection_id` INT NULL AUTO_INCREMENT,  `inspection_date` VARCHAR(8) NOT NULL,  `serial_number` INT NOT NULL,  `work_order_number` VARCHAR(11) NOT NULL,  `type` VARCHAR(15) NOT NULL,  `test_witness` VARCHAR(32) NOT NULL,  `cei_number` VARCHAR(4) NOT NULL,  `alt_power_req` VARCHAR(7) NOT NULL,  `firekeys` VARCHAR(7) NOT NULL,  `hydro_capacity` VARCHAR(8) NULL,  `hydro_full_load_pressure` VARCHAR(7) NULL,  `hydro_relief_pressure` VARCHAR(7) NULL,  `hydro_drop` VARCHAR(10) NULL,  `v1` VARCHAR(5) NULL,  `v1_comments` VARCHAR(255) NULL,  `v2` VARCHAR(5) NULL,  `v2_comments` VARCHAR(255) NULL,  `v3` VARCHAR(5) NULL,  `v3_comments` VARCHAR(255) NULL,  `v4` VARCHAR(5) NULL,  `v4_comments` VARCHAR(255) NULL,  `v5` VARCHAR(5) NULL,  `v5_comments` VARCHAR(255) NULL,  `v6` VARCHAR(5) NULL,  `v6_comments` VARCHAR(255) NULL,  `v7` VARCHAR(5) NULL,  `v7_comments` VARCHAR(255) NULL,  `v8` VARCHAR(5) NULL,  `v8_comments` VARCHAR(255) NULL,  `v9` VARCHAR(5) NULL,  `v9_comments` VARCHAR(255) NULL,  `mileage` INT NOT NULL,  `overtime` VARCHAR(10) NOT NULL,  `hours` VARCHAR(10) NOT NULL,  `bill_to` VARCHAR(255) NULL,  `maintenance_company` VARCHAR(255) NULL,  `client_sig` VARCHAR(65535) NULL,  `client_name` VARCHAR(75) NULL,  `client_title` VARCHAR(25) NULL,  `client_phone_number` INT NULL,  `client_type` VARCHAR(38) NULL ,PRIMARY KEY (`inspection_id`), UNIQUE KEY `PRIMARY` (`inspection_id`));
-- Create StateList
CREATE TABLE `StateList` ( `serial_number` INT NOT NULL,  `class_code` DOUBLE NULL,  `landings` DOUBLE NULL,  `last_passed` DATE NULL,  `location_name` VARCHAR(255) NULL,  `business_name` VARCHAR(255) NULL,  `location_address` VARCHAR(255) NULL,  `location_city` VARCHAR(255) NULL,  `location_state` VARCHAR(255) NULL,  `location_zip` VARCHAR(255) NULL,  `mailing_address` VARCHAR(255) NULL,  `mailing_address_2` VARCHAR(255) NULL,  `mailing_city` VARCHAR(255) NULL,  `mailing_state` VARCHAR(255) NULL,  `mailing_zip` VARCHAR(255) NULL,  `mailing_phone` VARCHAR(255) NULL,  `cert_status` VARCHAR(255) NULL,  `exp_date` DATE NULL,  `class_description` VARCHAR(255) NULL,  `year_installed` DOUBLE NULL,  `install_comp` VARCHAR(255) NULL,  `bldg_type` VARCHAR(255) NULL,  `capacity` DOUBLE NULL,  `speed_up` DOUBLE NULL,  `speed_down` DOUBLE NULL,  `travel` DOUBLE NULL,  `two_stop` VARCHAR(255) NULL,  `maint_cont` VARCHAR(255) NULL,  `maint_comp` VARCHAR(255) NULL,  `last_updated` DATETIME NULL ,PRIMARY KEY (`serial_number`), UNIQUE KEY `PRIMARY` (`serial_number`));
-- Create Users
CREATE TABLE `Users` ( `user_name` VARCHAR(255) NOT NULL,  `user_login` VARCHAR(255) NOT NULL,  `user_pass` VARCHAR(255) NOT NULL,  `user_level` VARCHAR(255) NOT NULL,  `user_id` INT NULL AUTO_INCREMENT,  `email` VARCHAR(255) NULL ,PRIMARY KEY (`user_id`), UNIQUE KEY `PRIMARY` (`user_id`));
-- Create vaa_inspections_2008
CREATE TABLE `vaa_inspections_2008` ( `work_order_number` INT NOT NULL,  `serial_number` INT NOT NULL,  `inspection_date` VARCHAR(8) NOT NULL,  `inspection_type` VARCHAR(11) NOT NULL,  `v1` VARCHAR(5) NOT NULL,  `v2` VARCHAR(5) NOT NULL,  `v3` VARCHAR(5) NOT NULL,  `v4` VARCHAR(5) NOT NULL,  `v5` VARCHAR(5) NOT NULL,  `v6` VARCHAR(5) NOT NULL,  `v7` VARCHAR(5) NOT NULL,  `v8` VARCHAR(5) NOT NULL,  `v9` VARCHAR(5) NOT NULL,  `cei_number` VARCHAR(4) NOT NULL,  `firekeys` VARCHAR(7) NOT NULL,  `alt_power_req` VARCHAR(7) NOT NULL,  `test_witness` VARCHAR(32) NOT NULL,  `hydro_capacity` VARCHAR(8) NOT NULL,  `hydro_full_load_pressure` VARCHAR(7) NOT NULL,  `hydro_relief_pressure` VARCHAR(7) NOT NULL,  `hydro_drop` VARCHAR(10) NOT NULL,  `v1_comments` VARCHAR(255) NOT NULL,  `v2_comments` VARCHAR(255) NOT NULL,  `v3_comments` VARCHAR(255) NOT NULL,  `v4_comments` VARCHAR(255) NOT NULL,  `v5_comments` VARCHAR(255) NOT NULL,  `v6_comments` VARCHAR(255) NOT NULL,  `v7_comments` VARCHAR(255) NOT NULL,  `v8_comments` VARCHAR(255) NOT NULL,  `v9_comments` VARCHAR(255) NOT NULL);
-- Create WeeklyDetails
CREATE TABLE `WeeklyDetails` ( `Mileage` VARCHAR(5) NOT NULL,  `Hours` VARCHAR(5) NOT NULL,  `Overtime` VARCHAR(5) NOT NULL,  `id` INT NULL AUTO_INCREMENT ,PRIMARY KEY (`id`), UNIQUE KEY `PRIMARY` (`id`));
