-- update departments default value
ALTER TABLE `#__spmedical_departments` CHANGE `created` `created` DATETIME NULL DEFAULT NULL;
ALTER TABLE `#__spmedical_departments` CHANGE `modified` `modified` DATETIME NULL DEFAULT NULL;
ALTER TABLE `#__spmedical_departments` CHANGE `checked_out_time` `checked_out_time` DATETIME NULL DEFAULT NULL;


-- add new fields to departments
ALTER TABLE `#__spmedical_departments` ADD `symptoms` TEXT NULL AFTER `description`;
ALTER TABLE `#__spmedical_departments` ADD `causes` TEXT NULL DEFAULT NULL AFTER `symptoms`;
ALTER TABLE `#__spmedical_departments` ADD `treatments_info` TEXT NULL DEFAULT NULL AFTER `causes`;

-- update specialists default value
ALTER TABLE `#__spmedical_specialists` CHANGE `created` `created` DATETIME NULL DEFAULT NULL; 
ALTER TABLE `#__spmedical_specialists` CHANGE `modified` `modified` DATETIME NULL DEFAULT NULL; 
ALTER TABLE `#__spmedical_specialists` CHANGE `checked_out_time` `checked_out_time` DATETIME NULL DEFAULT NULL;

-- add new fields to specialists
ALTER TABLE `#__spmedical_specialists` ADD `address` VARCHAR(200) NULL DEFAULT NULL AFTER `website`;
ALTER TABLE `#__spmedical_specialists` ADD `rating` VARCHAR(10) NULL DEFAULT NULL AFTER `address`;
ALTER TABLE `#__spmedical_specialists` ADD `services_year` VARCHAR(10) NULL DEFAULT NULL AFTER `rating`;
ALTER TABLE `#__spmedical_specialists` ADD `othersinfo` TEXT DEFAULT NULL AFTER `socials`;

-- update appointments default value
ALTER TABLE `#__spmedical_appointments` CHANGE `appintment_time` `appintment_time` TIME DEFAULT '00:00:00';
ALTER TABLE `#__spmedical_appointments` CHANGE `created` `created` DATETIME NULL DEFAULT NULL;
ALTER TABLE `#__spmedical_appointments` CHANGE `modified` `modified` DATETIME NULL DEFAULT NULL;
ALTER TABLE `#__spmedical_appointments` CHANGE `checked_out_time` `checked_out_time` DATETIME NULL DEFAULT NULL;
ALTER TABLE `#__spmedical_appointments` MODIFY `visitorip` VARCHAR(100) NULL DEFAULT NULL;

-- add new fields to appointments
ALTER TABLE `#__spmedical_appointments` ADD `choose_patient` tinyint(1) NOT NULL DEFAULT '1' AFTER `department_id`, ADD `date_of_birth` DATE DEFAULT NULL AFTER `choose_patient`, ADD `patient_gender` VARCHAR(5) NOT NULL DEFAULT 'm' AFTER `date_of_birth`, ADD `patient_address_street` VARCHAR(300) DEFAULT NULL AFTER `patient_gender`, ADD `patient_address_city` VARCHAR(300) DEFAULT NULL AFTER `patient_address_street`, ADD `patient_address_state` VARCHAR(300) DEFAULT NULL AFTER `patient_address_city`, ADD `patient_address_zip_code` INT(20) DEFAULT NULL AFTER `patient_address_state`, ADD `visiting_option` VARCHAR(200) DEFAULT NULL AFTER `patient_address_zip_code`;