Database Schema - nullgar/sky-bnb Wiki

Schema of the PostgresQL database

Sky-BnbV2

Users

column name data type details
id integer not null, primary key
username string(100) not null, unique
email email not null, unique
hashedPassword string.binary not null
createdAt datetime not null
updatedAt datetime not null
  • username and email must have unique values

Reservation

column name data type details
id int not null, primary key
locationId int not null
userId int not null
startDate datetime not null
endDate datetime not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references users.id

  • locationId references location.id

  • Images column name | data type | details -- | -- | -- id |int | not null, primary key locationId | int | not null url | varchar | not null createdAt | timestamp | not null updatedAt | timestamp | not null

  • locationId references location.id

Location

column name data type details
id int not null, primary key
userId int not null
address varchar not null, unique
city varchar not null
state/hold varchar not null
country varchar not null
name varchar not null
price/gold decimal not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references users.id

Sky-Bnb V1