DROP TABLE IF EXISTS PERSON_RESIDENCE;
CREATE TABLE PERSON_RESIDENCE (
ID_INTERNAL INT(11),
OID BIGINT(20),
DISTRICT VARCHAR(150),
DISTRICT_SUBDIVISION VARCHAR(150),
PARISH VARCHAR(150),
KEY_PERSON INT(11),
OID_PERSON BIGINT(20),
KEY_COUNTRY INT(11),
OID_COUNTRY BIGINT(20),
KEY_ROOT_DOMAIN_OBJECT INT(11),
OID_ROOT_DOMAIN_OBJECT BIGINT(20),
PRIMARY KEY(ID_INTERNAL)
) ENGINE = INNODB;

ALTER TABLE PERSON_RESIDENCE ADD INDEX KEY_PERSON(KEY_PERSON);
ALTER TABLE PERSON_RESIDENCE ADD INDEX OID_PERSON(OID_PERSON);
ALTER TABLE PERSON_RESIDENCE ADD INDEX KEY_COUNTRY(KEY_COUNTRY);
ALTER TABLE PERSON_RESIDENCE ADD INDEX OID_COUNTRY(OID_COUNTRY);
ALTER TABLE PERSON_RESIDENCE ADD INDEX KEY_ROOT_DOMAIN_OBJECT(KEY_ROOT_DOMAIN_OBJECT);
ALTER TABLE PERSON_RESIDENCE ADD INDEX OID_ROOT_DOMAIN_OBJECT(OID_ROOT_DOMAIN_OBJECT);