 
 USE empi;
 
+DROP TABLE subject_demographics;
 DROP TABLE subject_match_fields;
 DROP TABLE subject_identifier;
 DROP TABLE subject_identifier_domain;

ALTER TABLE resource_lock
    ADD CONSTRAINT resource_lock_pkey PRIMARY KEY (resource_id);

ALTER TABLE subject_address
    ADD CONSTRAINT subject_address_pkey PRIMARY KEY (subject_id, seq_no);


--
CREATE TABLE subject (
    id int NOT NULL,
    type char(1),
    last_updated_time datetime
);

--ALTER TABLE public.resource_lock OWNER TO empi;

--
--
--
CREATE TABLE subject_demographics (
    subject_id int NOT NULL,
    birth_time date,
    deceased_indicator bit,
    deceased_time date,
    multiple_birth_indicator bit,
    multiple_birth_order_number smallint,
    gender_code varchar(2),
    marital_status_code varchar(25),
    ethnic_group_code varchar(25),
