-- Revert gaia:doctor_2017_02_14_doctor_register from mysql

BEGIN;

DROP TABLE `doctor_doctorregisterlicence`;
DROP TABLE `doctor_doctorregisterrecord`;
DROP TABLE `doctor_doctorregisteragreement`;
DROP TABLE `doctor_doctorlicence`;
DROP TABLE `doctor_doctoreditrecord`;


ALTER TABLE `doctor_doctorregister` 
DROP FOREIGN KEY `city_id_refs_id_cbabbd94`,
DROP COLUMN `city_id`,
DROP COLUMN `address`,
DROP COLUMN `hospital_type`,
DROP FOREIGN KEY `related_hospital_id_refs_id_f94d246f`,
DROP COLUMN `related_hospital_id`,
DROP COLUMN `area_type`,
DROP COLUMN `status`,
DROP FOREIGN KEY `handler_id_refs_id_abae4307`,
DROP COLUMN `handler_id`,
DROP COLUMN `is_agreement_checked`,
MODIFY `email` varchar(100) NOT NULL DEFAULT '',
MODIFY `assist_phone` varchar(20) NOT NULL DEFAULT '',
MODIFY `business_licence` varchar(400) NOT NULL DEFAULT '',
MODIFY `practice_licence` varchar(400) NOT NULL DEFAULT '';


ALTER TABLE `api_doctor` 
DROP COLUMN `area_type`,
DROP COLUMN `assist_phone`,
DROP COLUMN `status`,
DROP COLUMN `last_edit_time`,
MODIFY `doc_email` varchar(100) NOT NULL DEFAULT '',
MODIFY `doc_birthday` varchar(40) NOT NULL DEFAULT '',
MODIFY `business_licence` varchar(400) NOT NULL DEFAULT '',
MODIFY `practice_licence` varchar(400) NOT NULL DEFAULT '';


COMMIT;
