Database Schema - StevelandOH/dogwlkr GitHub Wiki

Users

columnName dataTypes constraints
id integer not null, pk
imgUrl varchar
username varchar not null, unique
email varchar not null, unique
hashedPassword bytea not null
createdAt datetime not null
updatedAt datetime not null
  • Users.id hasMany Pets

Pets

columnName dataTypes constraints
id integer not null, pk
name varchar not null
imgPath varchar
breed varchar
birthday varchar
userId integer not null, fk
createdAt datetime not null
updatedAt datetime not null
  • Pet.id hasMany Routes
  • Pet.id hasMany Activities
  • userId belongsTo (references) Users.id

Activities

columnName dataTypes constraints
id integer not null, pk
petid integer not null, fk
type varchar not null
activityDate date not null
activityTime time not null
distance decimal
trainingFocus varchar
duration int
notes text
createdAt datetime not null
updatedAt datetime not null
  • petId belongsTo (references) Pets.id

Routes

columnName dataTypes constraints
id integer not null, pk
userId integer not null, fk
title varchar not null
mapImgUrl varchar not null
photoUrl varchar
description text
distance decimal not null
elevation decimal not null
createdAt datetime not null
updatedAt datetime not null
  • userId belongsTo (references) Users.id