--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = bbrk, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

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

CREATE TABLE loan_payment_detail_nupay (
    loan_payment_id integer NOT NULL,
    nupay_transaction_id bigint NOT NULL,
    nupay_result_code integer NOT NULL,
    nupay_reply_ts timestamp without time zone NOT NULL
);


ALTER TABLE bbrk.loan_payment_detail_nupay OWNER TO mysqltest;

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

ALTER TABLE ONLY loan_payment_detail_nupay
    ADD CONSTRAINT loan_payment_detail_nupay_pkey PRIMARY KEY (loan_payment_id);


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

ALTER TABLE ONLY loan_payment_detail_nupay
    ADD CONSTRAINT unq_lpdn_nupaytransactionreplystatus UNIQUE (nupay_transaction_id, nupay_reply_ts, nupay_result_code);


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

CREATE INDEX indx_lpdn_nupayresult ON loan_payment_detail_nupay USING btree (nupay_result_code);


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

CREATE INDEX indx_lpdn_nupaytransactionreply ON loan_payment_detail_nupay USING btree (nupay_transaction_id, nupay_reply_ts);


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

CREATE INDEX indx_lpdnupay_replyts ON loan_payment_detail_nupay USING btree (nupay_reply_ts);


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

CREATE TRIGGER tgr_loan_payment_detail_nupay_after_insert
    AFTER INSERT ON loan_payment_detail_nupay
    FOR EACH ROW
    EXECUTE PROCEDURE tgrf_loan_payment_detail_nupay_after_insert();


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

ALTER TABLE ONLY loan_payment_detail_nupay
    ADD CONSTRAINT fk_lpdn_payment FOREIGN KEY (loan_payment_id) REFERENCES loan_payments(dkey);


--
-- PostgreSQL database dump complete
--

