Skip to content

Commit a1ea4e9

Browse files
nickvisutcanjalal
andcommitted
add created_at timestamp to task table
Co-authored-by: Vincent Shuali <vincent.shuali@gmail.com>
1 parent 06fe422 commit a1ea4e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Each task should have a created_at date so that we can sort by assigned date
2+
-- 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
3+
ALTER TABLE task
4+
ADD COLUMN created_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
5+
6+
-- Add index to allow easy queries of tasks by date
7+
CREATE INDEX idx_created_at ON task(created_at);

0 commit comments

Comments
 (0)