-- -----------------------------------------------------------------
-- Rename tables location to area and columns location_id to area_id 
-- because there are confusion between location and system_location
-- -----------------------------------------------------------------
RENAME TABLE 	ic_location TO ic_area, 
				ic_location_extrainformation TO ic_area_extrainformation, 
				ic_control_location TO ic_control_area;

ALTER TABLE ic_control_approvers CHANGE location_id area_id INT NOT NULL DEFAULT 0;
ALTER TABLE ic_control_executers CHANGE location_id area_id INT NOT NULL DEFAULT 0;

ALTER TABLE ic_approvers CHANGE location_id area_id INT NULL DEFAULT NULL;

ALTER TABLE ic_control_area CHANGE location_id area_id INT NOT NULL DEFAULT 0;
ALTER TABLE ic_area_extrainformation CHANGE location_id area_id INT NOT NULL DEFAULT 0;
ALTER TABLE ic_system_location CHANGE location_id area_id INT NOT NULL DEFAULT 0;