Skip to content

Commit

Permalink
add created_at timestamp to task table
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Shuali <[email protected]>
  • Loading branch information
nickvisut and canjalal committed Nov 7, 2024
1 parent 06fe422 commit a1ea4e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/backend/db/migrations/4_add-created-at-on-tasks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Each task should have a created_at date so that we can sort by assigned date
-- NOTE: This relies on the assigned date never changing; if the app allows changes, we will likely want create a dedicated assigned_on date in addition to (or instead of) this column
ALTER TABLE task
ADD COLUMN created_at TIMESTAMPTZ NOT NULL DEFAULT NOW();

-- Add index to allow easy queries of tasks by date
CREATE INDEX idx_created_at ON task(created_at);

0 comments on commit a1ea4e9

Please sign in to comment.