Skip to content

Database Schema

Jacob Nicotra edited this page Jan 19, 2022 · 6 revisions

db-diagram.png

Users

Column name Data Type Details
id int not null, primary key
username string(255) not null, unique
email string(255) not null, unique
hashedPassword string.binary not null
cityId int foreign key
authority int
  • cityId references Cities table

Puzzle

Column name Data Type Details
id int not null, primary key
title string(100) not null
userId int not null, foreign key
cityId int foreign key
pieceCount int
image text
description text
  • userId references Users table
  • cityId references Cities table

SwapRequests

Column name Data Type Details
id int not null, primary key
userId int not null, foreign key
givePuzzleInstanceId int not null, foreign key
getPuzzleInstanceId int not null, foreign key
message text
  • userId references Users table
  • givePuzzleInstanceId references PuzzleInstances table
  • getPuzzleInstanceId references PuzzleInstances table

PuzzleReviews

Column name Data Type Details
id int not null, primary key
userId int not null, foreign key
puzzleId int not null, foreign key
rating int not null
description text
  • userId references Users table
  • puzzleId references Puzzles table

Images

Column name Data Type Details
id int not null, primary key
puzzleId int not null, foreign key
  • puzzleId references Puzzles table

PreviousOwners

Column name Data Type Details
id int not null, primary key
userId int not null, foreign key
puzzleId int not null, foreign key
  • userId references Users table
  • puzzleId references Puzzles table

Cities

Column name Data Type Details
id int not null, primary key
title string(100) not null

Clone this wiki locally