INSERT INTO tbloptions_static (name, value, autoload) VALUES('mileage_enable_odometer_readings', 'false', 1);

INSERT INTO tbloptions (tenant_id, name, value, autoload)
SELECT t.id,s.name,s.value,s.autoload
FROM tbltenants t
JOIN tbloptions_static s ON 1 = 1 AND s.name = 'mileage_enable_odometer_readings';


ALTER TABLE tblmileage_trips ADD start_odometer_reading varchar(50) DEFAULT NULL AFTER start_location;

ALTER TABLE tblmileage_trips ADD end_odometer_reading varchar(50) DEFAULT NULL AFTER end_location;


CREATE TABLE IF NOT EXISTS `tbltenant_business_hours` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `weekday` varchar(50) DEFAULT NULL,
  `is_working` tinyint(4) DEFAULT NULL,
  `start_time` varchar(100) DEFAULT NULL,
  `end_time` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE tblmileage_trips ADD is_manual_entry tinyint(4) NOT NULL DEFAULT 0 AFTER note;

SET @plan_feature_id = 71;
INSERT INTO tblplan_features_value (plans_id, plans_features_id, value,other_data,added_on) 
VALUES(9, @plan_feature_id, 0,'{"outside_message":"Mileage Logs is a pro feature, in order to use it Upgrade to PRO","inside_message":"Mileage Logs is a pro feature, in order to use it Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https:\/\/my.contractorplus.app\/","count":"0"}','2022-02-28 14:12:14'),
(10, @plan_feature_id, 0,'{"outside_message":"Mileage Logs is a pro feature, in order to use it Upgrade to PRO","inside_message":"Mileage Logs is a pro feature, in order to use it Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https:\/\/my.contractorplus.app\/","count":"0"}','2022-02-28 14:12:14'),
(11, @plan_feature_id, 1,NULL,'2022-02-28 14:12:14'),
(12, @plan_feature_id, 1,NULL,'2022-02-28 14:12:14'); 

UPDATE tblplan_features SET codename = 'mileage_log_module' WHERE codename = 'mileage_logs';

INSERT INTO tbltrial_details (module, no_of_trial_days, module_live_date,details,addedon) 
VALUES('mileage_log_module',15,'2022-02-28', '{"trial_active_details":{"icon":"assets\/images\/trial_icons\/trial_active.png","title":"Mileage Logs (Trial)","description":"Mileage Logs is a PRO feature. You have {no_of_trial_days_left} left on your free trial, after that, you\'ll need to choose a plan.","button_text":"UPGRADE PLAN"},"trial_expired_detials":{"icon":"assets\/images\/trial_icons\/trial_expired.png","title":"Trial Expired!","description":"Your trial of Mileage Logs Module has expired. To continue using Mileage Logs Module, choose a PRO plan now.","button_text":"UPGRADE PLAN"}}', '2021-12-02');




