forked from jackalnom/centralcoastcauldrons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
40 lines (37 loc) · 1.33 KB
/
schema.sql
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
create table
public.customer (
user_id bigint generated by default as identity,
customer_name text null,
payment text null,
constraint new_customer_pkey primary key (user_id)
) tablespace pg_default;
create table
public.global_inventory (
id bigint generated by default as identity,
gold integer not null default 0,
num_red_ml integer not null default 0,
num_green_ml integer not null default 0,
num_blue_ml integer not null default 0,
num_dark_ml integer not null default 0,
constraint new_global_inventory_pkey primary key (id)
) tablespace pg_default;
create table
public.orders (
order_no bigint generated by default as identity,
user_id bigint null,
potion_type text null,
quantity integer null default 0,
constraint order_pkey primary key (order_no),
constraint orders_potion_type_fkey foreign key (potion_type) references potions (potion_type),
constraint orders_user_id_fkey foreign key (user_id) references customer (user_id)
) tablespace pg_default;
create table
public.potions (
recipe integer[] null,
price integer null default 0,
inventory integer null default 0,
potion_type text not null,
desired_inventory integer not null default 0,
name text null,
constraint potions_pkey primary key (potion_type)
) tablespace pg_default;