· 5 years ago · Feb 25, 2020, 08:56 AM
1CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
2
3CREATE TABLE IF NOT EXISTS public."TransactionDetails"
4(
5 id SERIAL,
6 idx uuid DEFAULT uuid_generate_v1(),
7 customer_idx uuid not null,
8 first_name text COLLATE pg_catalog."default" NOT NULL,
9 transaction_date date not null,
10 from_date date not null,
11 is_active boolean not null DEFAULT true,
12 borrowed_amount float not NULL,
13 transaction_type text not null,
14 user_type text default 'User' not null,
15 outstanding_balance float not null,
16 created_on timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
17 is_obsolete boolean NOT NULL DEFAULT false,
18 modified_on timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
19 CONSTRAINT "TransactionDetails_pkey" PRIMARY KEY (id)
20)
21WITH (
22 OIDS = FALSE
23 )
24 TABLESPACE pg_default;
25
26
27ALTER TABLE public."TransactionDetails"
28 OWNER to postgres;
29
30
31CREATE TABLE IF NOT EXISTS public."EndReportHistory"
32(
33 id SERIAL,
34 idx uuid DEFAULT uuid_generate_v1(),
35 customer_idx uuid,
36 interest_amount float not null,
37 total_payable float not null,
38 total_amount_due float not null,
39 transaction_type text default 'Debit' not null,
40 transaction_date date not null,
41 outstanding_balance float not null,
42 user_type text default 'SystemEndReport' not null,
43 created_on timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
44 is_obsolete boolean NOT NULL DEFAULT false,
45 modified_on timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
46 CONSTRAINT "EndReportHistory_pkey" PRIMARY KEY (id)
47)
48WITH (
49 OIDS = FALSE
50)
51TABLESPACE pg_default;
52
53ALTER TABLE public."EndReportHistory"
54OWNER to postgres;