Skip to content

Database Schema

88joonyc edited this page Nov 4, 2021 · 11 revisions

Database Schema

Users

Column Name Data Type Details
id integer not null, primary key
first_name varchar not null
last_name varchar not null
email varchar not null, unique
image varchar
hashedPassword varchar not null
created_at timestamp not null
updated_at timestamp not null
  • UNIQUE index on [email]

Events

Column Name Data Type Details
id integer not null, primary key
host_id integer not null, foreign key
venue_id integer not null, foreign key
category_id integer not null, foreign key
name string(255) not null
details string(5000) not null
start_time datetime not null
end_time datetime not null
capacity integer not null
image string(500)
cost integer not null
created_at timestamp not null
updated_at timestamp not null
  • host_id references users Table
  • venue_id references venues Table
  • category_id references categories Table

Categories

Column Name Data Type Details
id integer not null, primary key
type string not null
created_at timestamp not null
updated_at timestamp not null

Venues

Column Name Data Type Details
id integer not null, primary key
name string not null
address string not null
city string not null
state string not null
zip_code integer not null
latitude integer not null
longitude integer not null
created_at timestamp not null
updated_at timestamp not null

Tickets

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
event_id integer not null
  • user_id references users Table
  • event_id references events Table

Hearts

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
event_id integer not null
  • user_id references users Table
  • event_id references events Table

Followers

Column Name Data Type Details
id integer not null, primary key
promoter_id integer not null
follower_id integer not null
  • promoter_id references users Table
  • user_id references users Table

Clone this wiki locally