Skip to content

Database Schema

CourtneyHoppus edited this page Sep 21, 2023 · 1 revision

Tables:

Users

  • UserID (Primary Key)
  • Name
  • Email
  • Password (hashed and salted)
  • CreatedOn
  • LastUpdated

Goals

  • GoalID (Primary Key)
  • UserID (Foreign Key)
  • Title
  • Description
  • StartDate
  • EndDate
  • IsCompleted
  • Progress
  • LastUpdated

Tasks

  • TaskID (Primary Key)
  • GoalID (Foreign Key)
  • Title
  • Description
  • StartDate
  • EndDate
  • IsCompleted
  • Progress
  • LastUpdated
  • TimeSpent

Tasks Have (Sub) Tasks

  • TaskID (Primary Key)
  • SubTaskID (Primary Key)
  • IsDependent

Activities

  • ActivityID (Primary Key)
  • GoalID (Foreign Key, nullable)
  • UserID (Foreign Key, nullable)
  • Title
  • Description
  • StartDate
  • EndDate
  • IsCompleted
  • TimeSpent

Goals Have Activities

  • GoalD (Primary Key)
  • ActivityID (Primary Key)

Blockers

  • BlockerID (Primary Key)
  • Description

Tasks Have Blockers

  • UserID (Primary Key)
  • BlockerID (Primary Key)
  • IsResolved

Reminders

  • ReminderID (Primary Key)
  • GoalID (Foreign Key, nullable)
  • TaskID (Foreign Key, nullable)
  • Message
  • ScheduledTime

Notifications

  • NotificationID (Primary Key)
  • UserID (Foreign Key)
  • Message
  • ScheduledTime

Relationships: A User can have multiple Goals : one-to-many A Goal can have multiple Tasks : one-to-many A Task can have multiple (Sub)Tasks, A (Sub) Task can multiple Tasks : many-to-many A Goal can have multiple Activities : one-to-many A User can have multiple Activities : one-to-many A Task can have multiple Blockers, A Blocker can have multiple tasks : many-to-many A User can have multiple Notifications : one-to-many A Goal can have multiple Reminders : one-to-many A Task can have multiple Reminders : one-to-many

Clone this wiki locally