CREATE TABLE "public"."complaint" ( complaint_id bigint PRIMARY KEY NOT NULL, address varchar(255), advice_given bool, against varchar(255), archive_box varchar(255), closed bool, code varchar(255), complainant_name varchar(255), complaint_name varchar(255), complaint_received timestamp, complaint_registered timestamp, date_case_closed timestamp, jurisdiction bool, mediation bool, phone_number varchar(255), referred bool, remarks varchar(255), short_name varchar(255), team varchar(255), cif_id int, closing_reason_id int, complainant_type_id int, complaint_category_id int, complaint_method_id int, complaint_type_id int, investigator_id int, lawyer_id int, outset_file_disposition_id int, province_id int ); ALTER TABLE complaint ADD CONSTRAINT fkac5efcab6b7eb744 FOREIGN KEY (complaint_category_id) REFERENCES complaint_category(complaint_category_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcabc1dc12e4 FOREIGN KEY (complaint_method_id) REFERENCES complaint_method(complaint_method_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcabf8d772c4 FOREIGN KEY (complaint_type_id) REFERENCES complaint_type(complaint_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcab2a577b07 FOREIGN KEY (lawyer_id) REFERENCES lawyer(lawyer_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcab7c637595 FOREIGN KEY (outset_file_disposition_id) REFERENCES outset_file_disposition(outset_file_disposition_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcabb5c08f27 FOREIGN KEY (investigator_id) REFERENCES investigator(investigator_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcabcd7f4ea FOREIGN KEY (complainant_type_id) REFERENCES complainant_type(complainant_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcab870c9c47 FOREIGN KEY (province_id) REFERENCES province(province_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcabfa0918d8 FOREIGN KEY (closing_reason_id) REFERENCES closing_reason(closing_reason_id) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE complaint ADD CONSTRAINT fkac5efcabb779d0d FOREIGN KEY (cif_id) REFERENCES cif(cif_id) ON DELETE NO ACTION ON UPDATE NO ACTION; CREATE UNIQUE INDEX complaint_pkey ON complaint(complaint_id);