CREATE TABLE ec_financial_transactions (
transaction_id varchar(20) PRIMARY KEY NOT NULL,
refunded_transaction_id varchar(20),
order_id integer,
shipment_id integer,
refund_id integer,
gift_certificate_id integer,
creditcard_id integer NOT NULL,
transaction_amount numeric(65535, 65531) NOT NULL,
refunded_amount numeric(65535, 65531),
transaction_type varchar(6) NOT NULL,
to_be_captured_p bool,
inserted_date timestamptz NOT NULL,
authorized_date timestamptz,
to_be_captured_date timestamptz,
marked_date timestamptz,
refunded_date timestamptz,
failed_p bool DEFAULT false,
CONSTRAINT ec_financial_tr_transaction_typ REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_creditcard_id_fkey REFERENCES ec_creditcards (),
CONSTRAINT $1 REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_gift_certificate_id_fkey REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_order_id_fkey REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_pkey REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_refund_id_fkey REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_refunded_transaction_id_fkey REFERENCES ec_creditcards (),
CONSTRAINT ec_financial_transactions_shipment_id_fkey REFERENCES ec_creditcards (),
CONSTRAINT $1 REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_tr_transaction_typ REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_creditcard_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_gift_certificate_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_order_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_pkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_refund_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_refunded_transaction_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_shipment_id_fkey REFERENCES ec_gift_certificates (),
CONSTRAINT ec_financial_transactions_creditcard_id_fkey REFERENCES ec_orders (),
CONSTRAINT $1 REFERENCES ec_orders (),
CONSTRAINT ec_financial_tr_transaction_typ REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_gift_certificate_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_order_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_pkey REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_refund_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_refunded_transaction_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_shipment_id_fkey REFERENCES ec_orders (),
CONSTRAINT ec_financial_transactions_order_id_fkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_shipment_id_fkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_refunded_transaction_id_fkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_refund_id_fkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_pkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_gift_certificate_id_fkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_creditcard_id_fkey REFERENCES ec_refunds (),
CONSTRAINT ec_financial_tr_transaction_typ REFERENCES ec_refunds (),
CONSTRAINT $1 REFERENCES ec_refunds (),
CONSTRAINT ec_financial_transactions_refunded_transaction_id_fkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_shipment_id_fkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_refund_id_fkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_pkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_order_id_fkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_gift_certificate_id_fkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_creditcard_id_fkey REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_tr_transaction_typ REFERENCES ec_financial_transactions (),
CONSTRAINT $1 REFERENCES ec_financial_transactions (),
CONSTRAINT ec_financial_transactions_shipment_id_fkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_transactions_refunded_transaction_id_fkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_transactions_refund_id_fkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_transactions_pkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_transactions_order_id_fkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_transactions_gift_certificate_id_fkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_transactions_creditcard_id_fkey REFERENCES ec_shipments (),
CONSTRAINT ec_financial_tr_transaction_typ REFERENCES ec_shipments (),
CONSTRAINT $1 REFERENCES ec_shipments ()
);
CREATE INDEX ec_finan_trans_by_cc_idx ON ec_financial_transactions (creditcard_id);
CREATE INDEX ec_finan_trans_by_gc_idx ON ec_financial_transactions (gift_certificate_id);
CREATE INDEX ec_finan_trans_by_order_idx ON ec_financial_transactions (order_id);
CREATE TRIGGER fin_trans_ccard_update_tr BEFORE INSERT FOR EACH ROW EXECUTE PROCEDURE fin_trans_ccard_update_tr (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341849 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341850 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341854 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341855 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341859 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341860 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341864 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341865 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_341867 AFTER DELETE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_del (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_341868 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341869 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341870 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341874 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_341875 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
-- Tables with foreign keys that refer to ec_financial_transactions:
--ec_financial_transactions($1)
--ec_financial_transactions(ec_financial_tr_transaction_typ)
--ec_financial_transactions(ec_financial_transactions_creditcard_id_fkey)
--ec_financial_transactions(ec_financial_transactions_gift_certificate_id_fkey)
--ec_financial_transactions(ec_financial_transactions_order_id_fkey)
--ec_financial_transactions(ec_financial_transactions_pkey)
--ec_financial_transactions(ec_financial_transactions_refund_id_fkey)
--ec_financial_transactions(ec_financial_transactions_refunded_transaction_id_fkey)
--ec_financial_transactions(ec_financial_transactions_shipment_id_fkey)
-- Table size: 0 bytes
-- Table rows: 0
Tables: