Skip to content

Database Schema

Zhuoxin Tan edited this page Aug 24, 2021 · 6 revisions

Database Schema

Users

column name data type details
id integer not null, primary key
username string not null, unique
email string not null, unique
icon string not null
hashedPassword string not null

Restaurants

column name data type details
id integer not null, primary key
ownerId integer not null, foreign key
title string(100) not null
phone string(20) not null
description textarea not null
address string(100) not null
city string(50) not null
state string(50) not null
zipCode string(20) not null
lat decimal
lng decimal
  • ownerId references Users Table, One user can have many restaurants.

Bookings

column name data type details
id integer not null, primary key
userId integer not null, foreign key
restaurantId integer not null, foreign key
size integer not null
startDate integer not null
startTime integer not null
  • userId references Users table
  • restaurantId references Restaurants table
  • many to many relationship, many users can make many reservations.

Clone this wiki locally