Skip to content

Database Schema

John Sims edited this page Jun 29, 2021 · 5 revisions

Users

Column name data type details
id int PK, not null
username string not null
hashedPassword string not null
email string not null, unique
farmer boolean not null

Farms

Column name data type details
id int PK, not null
name string not null
price_per_day numeric not null
image string not null
location string not null
userId int not null
  • userId references Users table

Bookings

Column name data type details
id int PK, not null
userId int not null
cost_of_stay numeric not null
startDay string not null
endDay string not null
farmId int not null
  • userId references Users table
  • farmId references Farms table

Reviews

Column name data type details
id int PK, not null
userId int not null
farmId int not null
review text not null
star int not null
  • userId references users table
  • farmId references farms table

Messages

Column name data type details
id int PK, not null
userId int not null
farmId int not null
message text not null

Clone this wiki locally