--
--

SET escape_string_warning = off;




--
-- Name: loan_payment_detail_bank_deposit; Type: TABLE; Schema: bbrk; Owner: mysqltest; Tablespace: 
--

CREATE TABLE loan_payment_detail_bank_deposit (
    loan_payment_id integer NOT NULL,
    bank_deposit_id bigint NOT NULL
);


ALTER TABLE bbrk.loan_payment_detail_bank_deposit OWNER TO mysqltest;

--
-- Name: loan_payment_detail_bank_deposit_pkey; Type: CONSTRAINT; Schema: bbrk; Owner: mysqltest; Tablespace: 
--

ALTER TABLE ONLY loan_payment_detail_bank_deposit
    ADD CONSTRAINT loan_payment_detail_bank_deposit_pkey PRIMARY KEY (loan_payment_id);


--
-- Name: fk_lpdbd_deposit; Type: INDEX; Schema: bbrk; Owner: mysqltest; Tablespace: 
--

CREATE INDEX fk_lpdbd_deposit ON loan_payment_detail_bank_deposit USING btree (bank_deposit_id);


--
-- Name: tgr_loan_payment_detail_bank_deposit_before_insert; Type: TRIGGER; Schema: bbrk; Owner: mysqltest
--

CREATE TRIGGER tgr_loan_payment_detail_bank_deposit_before_insert
    BEFORE INSERT ON loan_payment_detail_bank_deposit
    FOR EACH ROW
    EXECUTE PROCEDURE tgrf_loan_payment_detail_bank_deposit_before_insert();


--
-- Name: tgr_loan_payment_detail_bank_deposit_before_update; Type: TRIGGER; Schema: bbrk; Owner: mysqltest
--

CREATE TRIGGER tgr_loan_payment_detail_bank_deposit_before_update
    BEFORE UPDATE ON loan_payment_detail_bank_deposit
    FOR EACH ROW
    EXECUTE PROCEDURE tgrf_loan_payment_detail_bank_deposit_before_update();


--
-- Name: fk_lpdbd_deposit; Type: FK CONSTRAINT; Schema: bbrk; Owner: mysqltest
--

ALTER TABLE ONLY loan_payment_detail_bank_deposit
    ADD CONSTRAINT fk_lpdbd_deposit FOREIGN KEY (bank_deposit_id) REFERENCES bank_deposit(bank_deposit_id);


--
-- Name: fk_lpdbd_payment; Type: FK CONSTRAINT; Schema: bbrk; Owner: mysqltest
--

ALTER TABLE ONLY loan_payment_detail_bank_deposit
    ADD CONSTRAINT fk_lpdbd_payment FOREIGN KEY (loan_payment_id) REFERENCES loan_payments(dkey);


--
--

