forked from validatedpatterns/retail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
values-db-store.yaml
100 lines (97 loc) · 4.81 KB
/
values-db-store.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
clusterName: coffeeshopdb
clusterUsers:
- name: coffeeshopuser
databases:
- coffeeshopdb
- name: coffeeshopadmin
databases:
- coffeeshopdb
dbInitSQL: |-
\c coffeeshopdb;
DROP SCHEMA IF EXISTS inventory CASCADE;
CREATE SCHEMA inventory AUTHORIZATION coffeeshopuser;
DROP SCHEMA IF EXISTS coffeeshop CASCADE;
CREATE SCHEMA coffeeshop AUTHORIZATION coffeeshopuser;
DROP SCHEMA IF EXISTS kitchen CASCADE;
CREATE SCHEMA kitchen AUTHORIZATION coffeeshopuser;
DROP SCHEMA IF EXISTS barista CASCADE;
CREATE SCHEMA barista AUTHORIZATION coffeeshopuser;
alter table if exists coffeeshop.LineItems
drop constraint if exists FK6fhxopytha3nnbpbfmpiv4xgn;
drop table if exists coffeeshop.LineItems cascade;
drop table if exists coffeeshop.Orders cascade;
drop table if exists coffeeshop.OutboxEvent cascade;
create table coffeeshop.LineItems (
itemId varchar(255) not null,
item varchar(255),
lineItemStatus varchar(255),
name varchar(255),
price numeric(19, 2),
order_id varchar(255) not null,
primary key (itemId)
);
create table coffeeshop.Orders (
order_id varchar(255) not null,
loyaltyMemberId varchar(255),
location varchar(255),
orderSource varchar(255),
orderStatus varchar(255),
timestamp timestamp,
primary key (order_id)
);
create table coffeeshop.OutboxEvent (
id uuid not null,
aggregatetype varchar(255) not null,
aggregateid varchar(255) not null,
type varchar(255) not null,
timestamp timestamp not null,
payload varchar(8000),
tracingspancontext varchar(256),
primary key (id)
);
alter table if exists coffeeshop.LineItems
add constraint FK6fhxopytha3nnbpbfmpiv4xgn
foreign key (order_id)
references coffeeshop.Orders;
create sequence inventory.hibernate_sequence start 1 increment 1;
create table inventory.Inventory (
id int8 not null,
backOrderQuantity int4 not null,
inStockQuantity int4 not null,
lastSaleDate date,
lastStockDate date,
maxRetailPrice float8,
maximumQuantity int4 not null,
minimumQuantity int4 not null,
orderQuantity int4 not null,
reservedQuantity int4 not null,
unitCost float8,
productMaster_sku_id uuid,
primary key (id)
);
create table inventory.OutboxEvent (
id uuid not null,
aggregatetype varchar(255) not null,
aggregateid varchar(255) not null,
type varchar(255) not null,
timestamp timestamp not null,
payload varchar(8000),
tracingspancontext varchar(256),
primary key (id)
);
create table inventory.ProductMaster (
sku_id uuid not null,
item varchar(256),
primary key (sku_id)
);
alter table if exists inventory.Inventory add constraint FK4gqdqmrew97itl6ola2uh50tu
foreign key (productMaster_sku_id) references inventory.ProductMaster;
grant all on all tables in schema "coffeeshop" to coffeeshopuser;
grant all on all tables in schema "coffeeshop" to coffeeshopadmin;
grant all on all tables in schema "inventory" to coffeeshopuser;
grant all on all tables in schema "inventory" to coffeeshopadmin;
grant all on all tables in schema "barista" to coffeeshopuser;
grant all on all tables in schema "barista" to coffeeshopadmin;
grant all on all tables in schema "kitchen" to coffeeshopuser;
grant all on all tables in schema "kitchen" to coffeeshopadmin;