ALTER TABLE `mt_quote_list` ADD `bl_issue_agent_code` text;
ALTER TABLE `mt_quote_list` ADD `bl_issue_agent` text;
ALTER TABLE `mt_quote_list` ADD `mbl_status` text;
ALTER TABLE `mt_quote_list` ADD `hbl_status` text;
ALTER TABLE `mt_quote_list` ADD `free_days` text;
ALTER TABLE `mt_quote_list` ADD `do_issued` int NOT NULL DEFAULT '0';

CREATE TABLE `truck_master` (
  `id` int(11) NOT NULL,
  `truck_no` text COLLATE utf8_unicode_ci,
  `make` text COLLATE utf8_unicode_ci,
  `model_no` text COLLATE utf8_unicode_ci,
  `start_km` text COLLATE utf8_unicode_ci,
  `truck_type` text COLLATE utf8_unicode_ci,
  `fuel_cap` text COLLATE utf8_unicode_ci,
  `status` text COLLATE utf8_unicode_ci,
  `ownership` text COLLATE utf8_unicode_ci,
  `purchase_date` text COLLATE utf8_unicode_ci,
  `register_date` text COLLATE utf8_unicode_ci,
  `sale_date` text COLLATE utf8_unicode_ci,
  `engine_no` text COLLATE utf8_unicode_ci,
  `chassis_no` text COLLATE utf8_unicode_ci,
  `fuel_type` text COLLATE utf8_unicode_ci,
  `body_type` text COLLATE utf8_unicode_ci,
  `notes` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NULL DEFAULT NULL,
  `modified_by` text COLLATE utf8_unicode_ci,
  `current_location` text COLLATE utf8_unicode_ci
)

ALTER TABLE `truck_master`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `truck_master`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

  CREATE TABLE `driver_list` (
  `id` int(11) NOT NULL,
  `driver_name` text COLLATE utf8_unicode_ci,
  `status` text COLLATE utf8_unicode_ci,
  `driver_contact_no` text COLLATE utf8_unicode_ci,
  `citizen_id_no` text COLLATE utf8_unicode_ci,
  `license_no` text COLLATE utf8_unicode_ci,
  `license_issue_state` text COLLATE utf8_unicode_ci,
  `license_validity` text COLLATE utf8_unicode_ci,
  `home_address` text COLLATE utf8_unicode_ci,
  `village` text COLLATE utf8_unicode_ci,
  `district` text COLLATE utf8_unicode_ci,
  `police_station` text COLLATE utf8_unicode_ci,
  `state` text COLLATE utf8_unicode_ci,
  `country` text COLLATE utf8_unicode_ci,
  `joining_date` text COLLATE utf8_unicode_ci,
  `leaving_date` text COLLATE utf8_unicode_ci,
  `referred_by` text COLLATE utf8_unicode_ci,
  `ref_mobile_no` text COLLATE utf8_unicode_ci,
  `ref_vehicle_no` text COLLATE utf8_unicode_ci,
  `relation_with_ref_driver` text COLLATE utf8_unicode_ci,
  `license_upload_file` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date`  timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text COLLATE utf8_unicode_ci,
  `bank_name` text COLLATE utf8_unicode_ci,
  `account_no` text COLLATE utf8_unicode_ci,
  `account_name` text COLLATE utf8_unicode_ci,
  `ifsc_code` text COLLATE utf8_unicode_ci
)

ALTER TABLE `driver_list`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `driver_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

  CREATE TABLE `truck_statutory_list` (
  `id` int(11) NOT NULL,
  `truck_id` text COLLATE utf8_unicode_ci,
  `doc_type` text COLLATE utf8_unicode_ci,
  `reference` text COLLATE utf8_unicode_ci,
  `valid_from` text COLLATE utf8_unicode_ci,
  `valid_to` text COLLATE utf8_unicode_ci,
  `remarks` text COLLATE utf8_unicode_ci,
  `currency` text COLLATE utf8_unicode_ci,
  `fee` text COLLATE utf8_unicode_ci,
  `file_name` text COLLATE utf8_unicode_ci,
  `file_url` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_by` text COLLATE utf8_unicode_ci
) 

  ALTER TABLE `truck_statutory_list`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `truck_statutory_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;



CREATE TABLE `truck_driver_activity` (
  `id` int(11) NOT NULL,
  `truck_id` text COLLATE utf8_unicode_ci,
  `driver_id` text COLLATE utf8_unicode_ci,
  `driver_name` text COLLATE utf8_unicode_ci,
  `activity_date` text COLLATE utf8_unicode_ci,
  `status` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text COLLATE utf8_unicode_ci
)

ALTER TABLE `truck_driver_activity`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `truck_driver_activity`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

CREATE TABLE `country_master` (
  `id` int(11) NOT NULL,
  `country_code` text,
  `country_name` text,
  `country_uncode` text
)

ALTER TABLE `country_master`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `country_master`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=238;

  CREATE TABLE `driver_documents_list` (
  `id` int(11) NOT NULL,
  `driver_id` text COLLATE utf8_unicode_ci,
  `doc_type` text COLLATE utf8_unicode_ci,
  `notes` text COLLATE utf8_unicode_ci,
  `file_name` text COLLATE utf8_unicode_ci,
  `file_url` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text COLLATE utf8_unicode_ci
)
ALTER TABLE `driver_documents_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `driver_documents_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

  CREATE TABLE `driver_duty_history` (
  `id` int(11) NOT NULL,
  `driver_id` text COLLATE utf8_unicode_ci,
  `joining_date` text COLLATE utf8_unicode_ci,
  `leaving_date` text COLLATE utf8_unicode_ci,
  `reason_for_leaving` text COLLATE utf8_unicode_ci,
  `years_of_exp` text COLLATE utf8_unicode_ci,
  `vehicle_class` text COLLATE utf8_unicode_ci,
  `salary` text COLLATE utf8_unicode_ci,
  `pf` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text COLLATE utf8_unicode_ci
)
ALTER TABLE `driver_duty_history`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `driver_duty_history`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  CREATE TABLE `order_list` (
  `id` int(11) NOT NULL,
  `order_no` text COLLATE utf8_unicode_ci,
  `customer` text COLLATE utf8_unicode_ci,
  `customer_reference` text COLLATE utf8_unicode_ci,
  `quote_no` text COLLATE utf8_unicode_ci,
  `inclusive_of_toll` text COLLATE utf8_unicode_ci,
  `sales_person` text COLLATE utf8_unicode_ci,
  `round_trip` text COLLATE utf8_unicode_ci,
  `odo` text COLLATE utf8_unicode_ci,
  `quantity` text COLLATE utf8_unicode_ci,
  `uom` text COLLATE utf8_unicode_ci,
  `no_of_vehicles_required` text COLLATE utf8_unicode_ci,
  `cargo_description` text COLLATE utf8_unicode_ci,
  `transportation_type` text COLLATE utf8_unicode_ci,
  `transporter` text COLLATE utf8_unicode_ci,
  `routing_code` text COLLATE utf8_unicode_ci,
  `status` text COLLATE utf8_unicode_ci,
  `notes` text COLLATE utf8_unicode_ci,
  `service_type` text COLLATE utf8_unicode_ci,
  `vehicle_category` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text COLLATE utf8_unicode_ci,
  `truck_no` text COLLATE utf8_unicode_ci,
  `pod_status` text COLLATE utf8_unicode_ci
)

  ALTER TABLE `order_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `order_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=887;

  CREATE TABLE `trip_list` (
  `id` int(11) NOT NULL,
  `order_id` text,
  `trip_no` text,
  `trip_date` date DEFAULT NULL,
  `truck` text,
  `driver` text,
  `notes` text,
  `gr_wgt` text,
  `do_no` text,
  `container1` text,
  `seal1` text,
  `container2` text,
  `seal2` text,
  `grn` text,
  `lr_no` text,
  `lr_date` date DEFAULT NULL,
  `company_id` text,
  `location_id` text,
  `ip` text,
  `ua` text,
  `ekey` text,
  `created_by` text,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `temp_code` text,
  `inclusive_of_toll` text,
  `round_trip` text,
  `odo` text,
  `transportation_type` text,
  `routing_code` text,
  `transporter` text
)

ALTER TABLE `trip_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `trip_list`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1156;

  CREATE TABLE `order_party` (
  `id` int(11) NOT NULL,
  `order_id` text COLLATE utf8_unicode_ci,
  `party_type` text COLLATE utf8_unicode_ci,
  `party_name` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` text COLLATE utf8_unicode_ci
)

ALTER TABLE `order_party`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `order_party`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

  CREATE TABLE `order_route` (
  `id` int(11) NOT NULL,
  `trip_id` int(11) DEFAULT NULL,
  `order_id` text COLLATE utf8_unicode_ci,
  `leg_number` text COLLATE utf8_unicode_ci,
  `pickup_location` text COLLATE utf8_unicode_ci,
  `pickup_pin` text COLLATE utf8_unicode_ci,
  `pickup_address` text COLLATE utf8_unicode_ci,
  `dropoff_location` text COLLATE utf8_unicode_ci,
  `dropoff_pin` text COLLATE utf8_unicode_ci,
  `dropoff_address` text COLLATE utf8_unicode_ci,
  `notes` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NULL DEFAULT NULL,
  `modified_by` text COLLATE utf8_unicode_ci
)
ALTER TABLE `order_route`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `order_route`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1156;

  CREATE TABLE `order_rate` (
  `id` int(11) NOT NULL,
  `trip_id` int(11) DEFAULT NULL,
  `order_id` text COLLATE utf8_unicode_ci,
  `charge_code` text COLLATE utf8_unicode_ci,
  `basis` text COLLATE utf8_unicode_ci,
  `currency` text COLLATE utf8_unicode_ci,
  `ex_rate` text COLLATE utf8_unicode_ci,
  `tariff` text COLLATE utf8_unicode_ci,
  `customer` text COLLATE utf8_unicode_ci,
  `is_invoicable` text COLLATE utf8_unicode_ci,
  `remarks` text COLLATE utf8_unicode_ci,
  `location_id` text COLLATE utf8_unicode_ci,
  `company_id` text COLLATE utf8_unicode_ci,
  `created_by` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NULL DEFAULT NULL,
  `ip` text COLLATE utf8_unicode_ci,
  `ua` text COLLATE utf8_unicode_ci,
  `ekey` text COLLATE utf8_unicode_ci,
  `temp_code` text COLLATE utf8_unicode_ci,
  `modified_date` timestamp NULL DEFAULT NULL,
  `modified_by` text COLLATE utf8_unicode_ci,
  `invoiced` text COLLATE utf8_unicode_ci,
  `inv_pay_no` text COLLATE utf8_unicode_ci,
  `proforma_no` text COLLATE utf8_unicode_ci
)

CREATE TABLE `schedule_task` (
  `id` int NOT NULL,
  `report_no` text,
  `schedule_task_description` text,
  `tname` text,
  `cnames` text,
  `order_by` text,
  `file_name` text,
  `report_filters` json DEFAULT NULL,
  `recurrence_pattern` text,
  `rp_daily` text,
  `rp_daily_days` text,
  `rp_daily_scheduled_run_time` text,
  `range_of_recurrence` text,
  `rr_start_date` date DEFAULT NULL,
  `rr_end_after_occurrences` text,
  `rr_end_by` text,
  `email_to` text,
  `email_cc` text,
  `email_bcc` text,
  `ip` text,
  `uid` text,
  `ua` text,
  `ekey` text,
  `created_date` date DEFAULT NULL,
  `location_id` text,
  `company_id` text,
  `modified_by` text,
  `modified_date` date DEFAULT NULL,
  `temp_code` text,
  `rp_wk_monday` text,
  `rp_wk_tuesday` text,
  `rp_wk_wednesday` text,
  `rp_wk_thursday` text,
  `rp_wk_friday` text,
  `rp_wk_saturday` text,
  `rp_wk_sunday` text,
  `rp_wk_weeks_on` text,
  `rp_mon_pap_yr_day` text,
  `rp_mon_pap_yr_day_n` text,
  `rp_mon_pap_yr_every_n_month` text
)
ALTER TABLE `schedule_task`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `schedule_task`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

  CREATE TABLE `schedule_task_no_autogen` (
  `id` int NOT NULL,
  `company_name` text,
  `location_name` text,
  `doc_date` text,
  `doc_type` text,
  `order_id` int DEFAULT NULL,
  `order_no` text,
  `created_by` text,
  `created_date` text,
  `temp_code` text
)
ALTER TABLE `schedule_task_no_autogen`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `schedule_task_no_autogen`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

  CREATE TABLE `scheduled_task_email_sent_list` (
  `id` int NOT NULL,
  `schedule_task_description` text,
  `email_to` text,
  `email_cc` text,
  `email_bcc` text,
  `success` text,
  `aws_ses_msg` text,
  `created_date` text
)
ALTER TABLE `scheduled_task_email_sent_list`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `scheduled_task_email_sent_list`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=269;

  ALTER TABLE `salesman_effective_list` ADD `uid` TEXT NULL AFTER `temp_code`;
  ALTER TABLE `salesman_effective_list` ADD `modified_date` DATE NULL AFTER `uid`;
  ALTER TABLE `salesman_effective_list` ADD `modified_by` TEXT NULL AFTER `modified_date`;