Database Schema - ukiukica/splitzy Wiki

DB Schema_3 0

users

column name data type details
id integer not null, primary key
first_name string(50) not null
last_name string(50) not null
username string(40) not null
email string(100) not null, unique
hashed_password string(20) not null, BINARY
created_at date not null
updated_at date not null
  • index on email, unique: true

bills

column name data type details
id integer not null, primary key
label string(100) not null
amount float not null
settled boolean defaultValue: false
created_at date not null
updated_at date not null

comments

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
bill_id integer not null, foreign key
content string(2000) not null
created_at date not null
updated_at date not null
  • user_id references Users table
  • bill_id references Bills table

transactions

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
bill_id integer not null, foreign key
amount float not null
created_at date not null
updated_at date not null
  • user_id references Users table
  • bill_id references Bills table

user_bills

column name data type details
user_id integer not null, foreign key
bill_id integer not null, foreign key
amount float not null
  • user_id references Users table
  • bill_id references Bills table

friends

column name data type details
friend_id integer not null, foreign key
friended_id integer not null, foreign key
  • friend_id references Users table
  • friended_id references Users table