CREATE TABLE ec_customer_service_issues (
issue_id integer PRIMARY KEY NOT NULL,
user_identification_id integer NOT NULL,
order_id integer,
gift_certificate_id integer,
open_date timestamptz NOT NULL,
close_date timestamptz,
closed_by integer,
deleted_p bool DEFAULT false,
CONSTRAINT ec_customer_service_issues_gift_certificate_id_fkey REFERENCES users (),
CONSTRAINT ec_customer_service_issues_order_id_fkey REFERENCES users (),
CONSTRAINT ec_customer_service_issues_user_identification_id_fkey REFERENCES users (),
CONSTRAINT ec_customer_service_issues_closed_by_fkey REFERENCES users (),
CONSTRAINT ec_customer_service_issues_pkey REFERENCES users (),
CONSTRAINT ec_customer_service_issues_order_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_customer_service_issues_closed_by_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_customer_service_issues_gift_certificate_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_customer_service_issues_pkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_customer_service_issues_user_identification_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_customer_service_issues_user_identification_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_customer_service_issues_pkey REFERENCES ec_orders (),
CONSTRAINT ec_customer_service_issues_order_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_customer_service_issues_gift_certificate_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_customer_service_issues_closed_by_fkey REFERENCES ec_orders (),
CONSTRAINT ec_customer_service_issues_user_identification_id_fkey REFERENCES ec_user_identification (),
CONSTRAINT ec_customer_service_issues_closed_by_fkey REFERENCES ec_user_identification (),
CONSTRAINT ec_customer_service_issues_gift_certificate_id_fkey REFERENCES ec_user_identification (),
CONSTRAINT ec_customer_service_issues_order_id_fkey REFERENCES ec_user_identification (),
CONSTRAINT ec_customer_service_issues_pkey REFERENCES ec_user_identification ()
);
CREATE INDEX ec_csi_by_open_date ON ec_customer_service_issues (open_date);
CREATE INDEX ec_csi_by_user_ident_id ON ec_customer_service_issues (user_identification_id);
CREATE TRIGGER ec_cs_issue_inserts AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE ec_cs_issue_inserts (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_341782 AFTER DELETE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_del (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_341783 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_341817 AFTER DELETE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_del (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_341818 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341824 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341825 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341829 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341830 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341834 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341835 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341839 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341840 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
-- Tables with foreign keys that refer to ec_customer_service_issues:
--ec_cs_issue_type_map(ec_customer_service_issues_closed_by_fkey)
--ec_cs_issue_type_map(ec_customer_service_issues_gift_certificate_id_fkey)
--ec_cs_issue_type_map(ec_customer_service_issues_order_id_fkey)
--ec_cs_issue_type_map(ec_customer_service_issues_pkey)
--ec_cs_issue_type_map(ec_customer_service_issues_user_identification_id_fkey)
--ec_customer_service_actions(ec_customer_service_issues_closed_by_fkey)
--ec_customer_service_actions(ec_customer_service_issues_gift_certificate_id_fkey)
--ec_customer_service_actions(ec_customer_service_issues_order_id_fkey)
--ec_customer_service_actions(ec_customer_service_issues_pkey)
--ec_customer_service_actions(ec_customer_service_issues_user_identification_id_fkey)
-- Table size: 0 bytes
-- Table rows: 0
Tables: