Skip to content
passsionforprogramming edited this page Dec 12, 2019 · 12 revisions

Database Schema

Events

Column Name Data Type Details
id integer not null, primary key
title string not null
user_id integer not null
category string optional
type string optional
organizer string optional
start_time datetime not null
end_time datetime not null
display_start_time boolean not null
display_end_time boolean not null
timezone timestamp with timezone not null
image_url string optional
description text optional
published boolean not null
status string not null
sold float not null
gross float not null
created_at timestamp not null
updated_at timestamp not null

Location

Column Name Data Type Details
id integer not null, primary key
name text not null
address text not null
lat float optional
lon float optional
city string optional
zip integer optional
online boolean default: false
To_be_announced boolean default: false
event_id integer indexed key
created_at timestamp not null
updated_at timestamp not null

Tags

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

Videos

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

Images

Column Name Data Type Details
id integer not null, primary key
name string not null
event_id 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
ticket_code uuid not null
name string not null
owner_id integer optional
event_id integer not null
donation boolean not null
description text optional
type string not null
batch_id integer not null
created_at timestamp not null
updated_at timestamp not null

Batches

Column Name Data Type Details
id integer not null, primary key
sale_start_time datetime not null
sale_end_time datetime not null
visibility string not null
absorb_fees boolean not null
visibility string not null
quantity integer not null
min_num_tickets_sold integer not null
max_num_tickets_sold integer not null
sales_channel string not null
created_at timestamp not null
updated_at timestamp not null

Likes

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

Collections

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

Favorited_Events

Column Name Data Type Details
id integer not null, primary key
event_id integer not null
collection_id integer not null
created_at timestamp not null
updated_at timestamp not null

Contacts

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
contact_id integer not null
created_at timestamp not null
updated_at timestamp not null

Users

Column Name Data Type Details
id integer not null, primary key
email string not null indexed unique
session_token string not null indexed
password_digest string not null
profile_image_url string optional
prefix string optional
first_name string optional
last_name string optional
home_phone string optional
cell_phone string optional
job_title string optional
company string optional
website string optional
blog string optional
home_address_1 string optional
home_address_2 string optional
home_city string optional
home_zip string optional
home_country string optional
home_state string optional
billing_address_1 string optional
billing_address_2 string optional
billing_city string optional
billing_zip string optional
billing_country string optional
billing_state string optional
shipping_address_1 string optional
shipping_address_2 string optional
shipping_city string optional
shipping_zip string optional
shipping_country string optional
shipping_state string optional
work_address_1 string optional
work_address_2 string optional
work_city string optional
work_zip string optional
work_country string optional
work_state string optional
created_at timestamp not null
updated_at timestamp not null
interests string array

Email Preferences

Column Name Data Type Details
id integer not null, primary key
user_id string not null indexed unique
features boolean not null indexed
friends_buy_tickets boolean not null
sales boolean optional
reminders_liked boolean optional
tips_organizing_events boolean optional
reminders_my_next_event boolean optional
order_notifications boolean optional
prefix string optional

Credit Cards

Column Name Data Type Details
id integer not null, primary key
owner_id string not null indexed unique
Clone this wiki locally