Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OTSWithFeign
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bhaskar Katakam
OTSWithFeign
Commits
22c8d541
Commit
22c8d541
authored
Apr 15, 2020
by
Naren Medarametla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified table names n fields wrt to store consumer scripts
parent
46315e2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
36 deletions
+35
-36
readme.md
readme.md
+35
-36
No files found.
readme.md
View file @
22c8d541
...
...
@@ -27,32 +27,32 @@ Go to Add New Server --> Give any database name --> go to connection tab and pro
```
bash
Host
=
127.0.0.1
Port
=
5432
username
=
user
password
=
password
123
username
=
postgres
password
=
welcome
123
```
Then click on save
In Header click on Tool -> Query Tool --> and paste the below query
```
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,
terminal 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,
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
;
ALTER TABLE public.offerlookup
ALTER TABLE public.offer
_
lookup
OWNER to
"postgress"
;
```
...
...
@@ -60,18 +60,18 @@ ALTER TABLE public.offerlookup
```
bash
Once you create use the below query to insert a data
INSERT INTO public.offerlookup
(
store_id, terminal, offer_type, offer_id, pre_condition,
offer_lookup_
id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
'o1'
,
'AND'
,
'54321'
)
;
INSERT INTO public.offerlookup
(
store_id, terminal, offer_type, offer_id, pre_condition,
offer_lookup_
id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
'o2'
,
'AND'
,
'54321'
)
;
INSERT INTO public.offerlookup
(
store_id, terminal, offer_type, offer_id, pre_condition,
offer_lookup_
id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
'o3'
,
'AND'
,
'54321'
)
;
INSERT INTO public.offerlookup
(
store_id, terminal, offer_type, offer_id, pre_condition,
offer_lookup_
id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
'o4'
,
'AND'
,
'54321'
)
;
INSERT INTO public.offer
_
lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,
id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
1,
'AND'
,54321
)
;
INSERT INTO public.offer
_
lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
2,
'AND'
,54321
)
;
INSERT INTO public.offer
_
lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
3,
'AND'
,54321
)
;
INSERT INTO public.offer
_
lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,
4,
'AND'
,54321
)
;
```
...
...
@@ -111,7 +111,7 @@ INSERT INTO endofsale VALUES ( uuid_generate_v4() ,
CREATE TABLE public.offer_meta_data
(
offer
id text
COLLATE pg_catalog."default" NOT NULL,
offer
_id INTEGER
COLLATE pg_catalog."default" NOT NULL,
eligibility text COLLATE pg_catalog."default" NOT NULL,
discount_type 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
end_time timestamp with time zone NOT NULL,
offer_desc 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,
CONSTRAINT offer_meta_data_pkey PRIMARY KEY (offerid)
rcpt_t
e
xt text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT offer_meta_data_pkey PRIMARY KEY (offer
_
id)
)
TABLESPACE pg_default;
...
...
@@ -141,28 +141,27 @@ dummy data
==========
INSERT INTO public.offer_meta_data(
offer
id, eligibility, discount_type, offer_meta_
status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES (
'o1'
,'elgibility','dicounted','Active','2020-04-14 19:10:25','2020-04-15 19:10:25',
offer
_id, eligibility, discount_type,
status, start_time,end_time,
offer_desc,offer_type,rcpt_t
e
xt)
VALUES (
1
,'elgibility','dicounted','Active','2020-04-14 19:10:25','2020-04-15 19:10:25',
'30 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data(
offer
id, eligibility, discount_type, offer_meta_
status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES (
'o2'
,'elgibility','dicounted','InActive','2020-04-14 19:10:25','2020-04-15 19:10:25',
offer
_id, eligibility, discount_type,
status, start_time,end_time,
offer_desc,offer_type,rcpt_t
e
xt)
VALUES (
2
,'elgibility','dicounted','InActive','2020-04-14 19:10:25','2020-04-15 19:10:25',
'20 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data(
offer
id, eligibility, discount_type, offer_meta_
status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES (
'o3'
,'elgibility','dicounted','Active','2020-04-15 19:10:25','2020-04-16 19:10:25',
offer
_id, eligibility, discount_type,
status, start_time,end_time,
offer_desc,offer_type,rcpt_t
e
xt)
VALUES (
3
,'elgibility','dicounted','Active','2020-04-15 19:10:25','2020-04-16 19:10:25',
'10 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data(
offer
id, eligibility, discount_type, offer_meta_
status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES (
'o4'
,'elgibility','dicounted','Active','2020-04-1 19:10:25','2020-04-15 19:10:25',
offer
_id, eligibility, discount_type,
status, start_time,end_time,
offer_desc,offer_type,rcpt_t
e
xt)
VALUES (
4
,'elgibility','dicounted','Active','2020-04-1 19:10:25','2020-04-15 19:10:25',
'05 percent','5','RCPT TXT');
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment