Skip to content

Database Schema

Andrew Murray edited this page Mar 22, 2022 · 17 revisions

db_schema

Users

column name data type details
id integer not null, primary key
username string(50) not null, unique
email string(100) not null, unique
hashed_password string not null
profile_pic_url string(500)

Characters

column name data type details
id integer not null, primary key
type string(50) not null
name string(100) not null
class string(50) not null
level integer not null
background string(50) not null
race string(50) not null
alignment string(50) not null
experience integer not null
strength integer not null
dexterity integer not null
constitution integer not null
intelligence integer not null
wisdom integer not null
charisma integer not null
armor_class integer not null
speed integer not null
max_hp integer not null
current_hp integer not null
temporary_hp integer not null
hit_dice_total integer not null
hit_dice integer not null
weapons text
equipment text
gold_pieces integer not null
silver_pieces integer not null
copper_pieces integer not null
features text
biography text
campaign_id int foreign key
user_id int not null, foreign key
  • campaign_id references Campaigns table
  • user_id references Users table

Campaigns

column name data type details
id integer not null, primary key
title string(50) not null
description text
owner integer not null, foreign key
game_master_id integer foreign key
  • owner references Users table
  • game_master_id references Users table

CampaignUsers

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
campaign_id integer not null, foreign key
  • user_id references Users table
  • campaign_id references Campaigns table

Sections

column name data type details
id integer not null, primary key
title string(50) not null
campaign_id integer not null, foreign key
  • campaign_id references Campaigns table

Articles

column name data type details
id integer not null, primary key
title string(50) not null
content text
photo_url string(500)
section_id integer not null, foreign key
  • section_id references Sections table

Clone this wiki locally