Commit 22c8d541 authored by Naren Medarametla's avatar Naren Medarametla

Modified table names n fields wrt to store consumer scripts

parent 46315e2b
...@@ -27,32 +27,32 @@ Go to Add New Server --> Give any database name --> go to connection tab and pro ...@@ -27,32 +27,32 @@ Go to Add New Server --> Give any database name --> go to connection tab and pro
```bash ```bash
Host = 127.0.0.1 Host = 127.0.0.1
Port = 5432 Port = 5432
username = user username = postgres
password = password123 password = welcome123
``` ```
Then click on save Then click on save
In Header click on Tool -> Query Tool --> and paste the below query In Header click on Tool -> Query Tool --> and paste the below query
```bash ```bash
-- Table: public.offerlookup -- Table: public.offer_lookup
-- DROP TABLE public.offerlookup; -- DROP TABLE public.offer_lookup;
CREATE TABLE public.offerlookup CREATE TABLE public.offer_lookup
( (
offer_lookup_id text COLLATE pg_catalog."default" NOT NULL, id INTEGER, COLLATE pg_catalog."default" NOT NULL,
store_id text COLLATE pg_catalog."default" NOT NULL, store_id text COLLATE pg_catalog."default" NOT NULL,
terminal text COLLATE pg_catalog."default" NOT NULL, terminal text COLLATE pg_catalog."default" NOT NULL,
offer_type text COLLATE pg_catalog."default" NOT NULL, offer_type text COLLATE pg_catalog."default" NOT NULL,
offer_id text COLLATE pg_catalog."default" NOT NULL, offer_id text COLLATE pg_catalog."default" NOT NULL,
pre_condition text COLLATE pg_catalog."default" NOT NULL, pre_condition text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "OfferLookup_pkey" PRIMARY KEY (offer_lookup_id) CONSTRAINT "OfferLookup_pkey" PRIMARY KEY (id, offer_type,offer_id)
) )
TABLESPACE pg_default; TABLESPACE pg_default;
ALTER TABLE public.offerlookup ALTER TABLE public.offer_lookup
OWNER to "postgress"; OWNER to "postgress";
``` ```
...@@ -60,18 +60,18 @@ ALTER TABLE public.offerlookup ...@@ -60,18 +60,18 @@ ALTER TABLE public.offerlookup
```bash ```bash
Once you create use the below query to insert a data Once you create use the below query to insert a data
INSERT INTO public.offerlookup( INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id) store_id, terminal, offer_type, offer_id, pre_condition, id)
VALUES ('0001','001','Customer','o1','AND','54321'); VALUES ('0001','001','Customer',1,'AND',54321);
INSERT INTO public.offerlookup( INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id) store_id, terminal, offer_type, offer_id, pre_condition,id)
VALUES ('0001','001','Customer','o2','AND','54321'); VALUES ('0001','001','Customer',2,'AND',54321);
INSERT INTO public.offerlookup( INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id) store_id, terminal, offer_type, offer_id, pre_condition,id)
VALUES ('0001','001','Customer','o3','AND','54321'); VALUES ('0001','001','Customer',3,'AND',54321);
INSERT INTO public.offerlookup( INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id) store_id, terminal, offer_type, offer_id, pre_condition,id)
VALUES ('0001','001','Customer','o4','AND','54321'); VALUES ('0001','001','Customer',4,'AND',54321);
``` ```
...@@ -111,7 +111,7 @@ INSERT INTO endofsale VALUES ( uuid_generate_v4() , ...@@ -111,7 +111,7 @@ INSERT INTO endofsale VALUES ( uuid_generate_v4() ,
CREATE TABLE public.offer_meta_data CREATE TABLE public.offer_meta_data
( (
offerid text COLLATE pg_catalog."default" NOT NULL, offer_id INTEGER COLLATE pg_catalog."default" NOT NULL,
eligibility text COLLATE pg_catalog."default" NOT NULL, eligibility text COLLATE pg_catalog."default" NOT NULL,
discount_type text COLLATE pg_catalog."default" NOT NULL, discount_type text COLLATE pg_catalog."default" NOT NULL,
status text COLLATE pg_catalog."default" NOT NULL, status text COLLATE pg_catalog."default" NOT NULL,
...@@ -119,8 +119,8 @@ CREATE TABLE public.offer_meta_data ...@@ -119,8 +119,8 @@ CREATE TABLE public.offer_meta_data
end_time timestamp with time zone NOT NULL, end_time timestamp with time zone NOT NULL,
offer_desc text COLLATE pg_catalog."default" NOT NULL, offer_desc text COLLATE pg_catalog."default" NOT NULL,
offer_type text COLLATE pg_catalog."default" NOT NULL, offer_type text COLLATE pg_catalog."default" NOT NULL,
rcpt_txt text COLLATE pg_catalog."default" NOT NULL, rcpt_text text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT offer_meta_data_pkey PRIMARY KEY (offerid) CONSTRAINT offer_meta_data_pkey PRIMARY KEY (offer_id)
) )
TABLESPACE pg_default; TABLESPACE pg_default;
...@@ -141,28 +141,27 @@ dummy data ...@@ -141,28 +141,27 @@ dummy data
========== ==========
INSERT INTO public.offer_meta_data( INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time, offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_txt) offer_desc,offer_type,rcpt_text)
VALUES ('o1','elgibility','dicounted','Active','2020-04-14 19:10:25','2020-04-15 19:10:25', VALUES (1,'elgibility','dicounted','Active','2020-04-14 19:10:25','2020-04-15 19:10:25',
'30 percent','5','RCPT TXT'); '30 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data( INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time, offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_txt) offer_desc,offer_type,rcpt_text)
VALUES ('o2','elgibility','dicounted','InActive','2020-04-14 19:10:25','2020-04-15 19:10:25', VALUES (2,'elgibility','dicounted','InActive','2020-04-14 19:10:25','2020-04-15 19:10:25',
'20 percent','5','RCPT TXT'); '20 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data( INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time, offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_txt) offer_desc,offer_type,rcpt_text)
VALUES ('o3','elgibility','dicounted','Active','2020-04-15 19:10:25','2020-04-16 19:10:25', VALUES (3,'elgibility','dicounted','Active','2020-04-15 19:10:25','2020-04-16 19:10:25',
'10 percent','5','RCPT TXT'); '10 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data( INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time, offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_txt) offer_desc,offer_type,rcpt_text)
VALUES ('o4','elgibility','dicounted','Active','2020-04-1 19:10:25','2020-04-15 19:10:25', VALUES (4,'elgibility','dicounted','Active','2020-04-1 19:10:25','2020-04-15 19:10:25',
'05 percent','5','RCPT TXT'); '05 percent','5','RCPT TXT');
``` ```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment