Conversation
…, insert requests) and add migration to add column request_version to requests table and also make it so created_at which contains date created reflects the version because shud be the same
4fc102d to
97e712e
Compare
Dao-Ho
left a comment
There was a problem hiding this comment.
Left some thoughts on this, overall you nailed the essence of what we want to do 🔥 🔥 Would love to hear what you think though
| -- drop default expression so that we can specify ourselves what we want for future inserts | ||
| -- this is just to modify existing data that we already have in the DB | ||
| ALTER TABLE public.requests | ||
| ALTER COLUMN request_version DROP DEFAULT; |
There was a problem hiding this comment.
I'd move this migration to a separate pr and merge/apply the migration before we actually update the query.
| ID string `json:"id" example:"530e8400-e458-41d4-a716-446655440000"` | ||
| CreatedAt time.Time `json:"created_at" example:"2024-01-02T00:00:00Z"` | ||
| UpdatedAt time.Time `json:"updated_at" example:"2024-01-02T00:00:00Z"` | ||
| RequestVersion time.Time `json:"request_version" example:"2024-01-02T00:00:00Z"` |
There was a problem hiding this comment.
What is the difference between request_version and updated_at? 🤔 Maybe we don't need both
Also a couple of ways I think we can interpret/design the storage of this data. We can either maintain the original created_at across all versions that we insert, or we could handle that in our find query (fetch the latest request but return the request_version of the first version, which we'll have to do for all queries fetching requests). I'll leave this design decision up to you.
Description
First PR that simply adds request versioning column to supabase thru migration & modifies existing request enpoints to fetch the request with the latest version (in case of same ids)
Type of Change
Related Issue(s)
Closes #
Related to # #108
What Changed?
Testing & Validation
I only modified existing tests for our requests endpoints and made sure they passed.
How this was tested
Screenshots/Recordings
Unfinished Work & Known Issues
Notes & Nuances
Pre-Merge Checklist
Code Quality
Testing & CI
Documentation
Reviewer Notes