-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MVP data models for goals, subgoals(benchmarks), tasks. #157
Changes from 6 commits
cd9bbed
6777833
cef9730
9ca8dd8
bcbdd56
1880ee3
56f497f
76e74eb
1bdc52e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -45,7 +45,8 @@ CREATE TABLE "student" ( | |||||
first_name TEXT NOT NULL, | ||||||
last_name TEXT NOT NULL, | ||||||
email TEXT NOT NULL UNIQUE, | ||||||
assigned_case_manager_id UUID REFERENCES "user" (user_id) ON DELETE SET NULL | ||||||
assigned_case_manager_id UUID REFERENCES "user" (user_id) ON DELETE SET NULL, | ||||||
grade SMALLINT | ||||||
); | ||||||
|
||||||
CREATE TABLE "file" ( | ||||||
|
@@ -70,12 +71,40 @@ CREATE TABLE "goal" ( | |||||
goal_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), -- TODO: add index to allow reordering | ||||||
iep_id UUID REFERENCES "iep" (iep_id), | ||||||
description TEXT NOT NULL, | ||||||
category TEXT NOT NULL CHECK (category IN ('writing', 'reading', 'math', 'other')), | ||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() | ||||||
); | ||||||
|
||||||
CREATE TABLE "subgoal" ( | ||||||
subgoal_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), -- TODO: add index to allow reordering | ||||||
goal_id UUID REFERENCES "goal" (goal_id), | ||||||
description TEXT NOT NULL, | ||||||
instructions TEXT NOT NULL DEFAULT '', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Consistent quotes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried this first, and found out that in SQL, single and double quotes actually have different meanings. Single quotes are for string literals, while double quotes are "delimited identifiers", meaning they reference tables or columns. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah - thanks for the info. TIL |
||||||
target_max_attempts INTEGER, --How many "questions" to administer in a single sitting | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This depends on the type of subgoal this is - e.g. quantitative vs behavioral. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's one reason I left it as an optional column. But I believe we discussed with Niko that our MVP would focus on one collection type, with plans to add more in the future. Maybe we can brainstorm better options for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SG. Let's get this PR merged in, and we can update it later. |
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() | ||||||
|
||||||
-- Different collection types may be added later: | ||||||
-- collection_type TEXT NOT NULL CHECK (collection_type IN ('attempt', 'behavioral')), | ||||||
); | ||||||
|
||||||
CREATE TABLE "task" ( | ||||||
task_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), | ||||||
subgoal_id UUID REFERENCES "subgoal" (subgoal_id), | ||||||
assignee_id UUID REFERENCES "user" (user_id), | ||||||
due_date TIMESTAMPTZ NOT NULL | ||||||
); | ||||||
|
||||||
CREATE TABLE "trial_data" ( | ||||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), | ||||||
subgoal_id UUID REFERENCES "subgoal" (subgoal_id), | ||||||
created_by_user_id UUID REFERENCES "user" (user_id), | ||||||
-- TODO: Possibly add optional reference to "task" | ||||||
success_with_prompt INTEGER NOT NULL, | ||||||
success_without_prompt INTEGER NOT NULL, | ||||||
notes TEXT,-- Optional depending on type of task | ||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() | ||||||
); | ||||||
|
||||||
-- Potential schema for different collection types: | ||||||
-- type TEXT NOT NULL CHECK (type IN ('attempt', 'behavioral')) -- enum - type of subgoal | ||||||
-- data jsonb -- actual data, e.g. attempt_counts etc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newest mockups have grade on the student table and on students' pages. Although I forgot to implement it elsewhere. I can either a) remove it for now and let another issue handle it or b) write a todo comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, try to keep a PR self contained that is focused on a specific feature/bug. This field would ideally be in the PR that adds that to the frontend/backend, but since you have already added it here, I will leave it to your discretion if you want to leave it in or remove it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Sometimes I think of something and just toss it in, but I'll try to keep things more self contained from now on.