Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kate delivereat #5

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/dist
/static/bundle.js
/static/bundle.js.map
.env
.DS_Store
56 changes: 56 additions & 0 deletions database.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
create database food_heaven;

create table menu(
id serial,
name varchar(50) NOT NULL UNIQUE,
price float(2) NOT NULL,
PRIMARY KEY (id)
);

CREATE TABLE "order" (
id serial primary key
);

create table menu_order(
id serial primary key,
menu_id int NOT NULL,
order_id int NOT NULL,
quantity int NOT NULL,
foreign key(menu_id) references menu(id),
foreign key(order_id) references "order"(id)

)

INSERT INTO menu(name, price) VALUES ('Taro Dumplings',5);
INSERT INTO menu(name, price) VALUES ('Steamed Egg (v)',5);
INSERT INTO menu(name, price) VALUES ('XO Bone Marrow Cornish King Scallop',7);
INSERT INTO menu(name, price) VALUES ('Sweet & Sour Balsamic Aubergine (v)',7);
INSERT INTO menu(name, price) VALUES ('Mapo Tofu (v)',12);
INSERT INTO menu(name, price) VALUES ('Chilli Egg Drop Crab & Salmon Roe',18);
INSERT INTO menu(name, price) VALUES ('Char Siu Iberico Pork',20);
INSERT INTO menu(name, price) VALUES ('Black Mountain Goose',30);
INSERT INTO menu(name, price) VALUES ('Strawberry Cheesecake',6);
INSERT INTO menu(name, price) VALUES ('Soufflé',6);

alter table menu add column image_name text;
update menu set image_name='Taro Dumplings.jpg' where id=1;
update menu set image_name= 'Steamed Egg (v).jpg' where id=2;
update menu set image_name='XO Bone Marrow Cornish King Scallop.jpg' where id=3;
update menu set image_name='Sweet & Sour Balsamic Aubergine (v).jpg' where id=4;
update menu set image_name='Mapo Tofu (v).jpg' where id=5;
update menu set image_name='Chilli Egg Drop Crab & Salmon Roe.jpg' where id=6;
update menu set image_name='Char Siu Iberico Pork.jpg' where id=7;
update menu set image_name='Black Mountain Goose.jpg' where id=8;
update menu set image_name='Strawberry Cheesecake.jpg' where id=9;
update menu set image_name='Soufflé.jpg' where id=10;

create table "user" (
id serial primary key,
name varchar(50) not null,
phone text not null
);

alter table "order" add column user_id int;
alter table "order"
add foreign key (user_id)
references "user"(id);
Loading