feat: add created_at column to rollovers table#838
Open
joejohnson123[bot] wants to merge 3 commits intodevfrom
Open
feat: add created_at column to rollovers table#838joejohnson123[bot] wants to merge 3 commits intodevfrom
joejohnson123[bot] wants to merge 3 commits intodevfrom
Conversation
- Add nullable created_at timestamp with SQL default NOW() to rollovers table - Set created_at on new rollover construction in rolloverUtils - Update test fixtures to include created_at - Existing rollovers will have NULL created_at, new ones get auto-timestamped Co-authored-by: Joe Johnson (JJ) <joejohnson123[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Joe Johnson (JJ) <joejohnson123[bot]@users.noreply.github.com>
Co-authored-by: Joe Johnson (JJ) <joejohnson123[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
created_attimestamp column to therolloverstable.Changes
rolloverTable.ts: Addedcreated_atcolumn as nullabletimestamp with time zonewithdefaultNow()— existing rows will haveNULL, new rows get auto-timestamped by PostgresrolloverUtils.ts: Setcreated_at: new Date()when constructing new rollovers ingetRolloverUpdatescreated_atNotes
DEFAULT NOW()means even if application code doesn't passcreated_at, the DB will set it...curRollover) inapplyExistingRollovers.tsandgetNewProductRollovers.tswill carry over the originalcreated_at(orundefined→ DB default)drizzle-kit generate+drizzle-kit migrateto apply the migrationSummary by cubic
Add a created_at timestamp to rollovers to track when each rollover was created. Existing rows stay unchanged; new rows are auto-stamped by Postgres.
New Features
Migration
Written for commit 26d426d. Summary will update on new commits.
Greptile Summary
Added a
created_attimestamp column to the rollovers table for tracking when rollovers are created. The column is nullable to maintain backward compatibility with existing data and has a database default ofNOW()to ensure new rows are automatically timestamped.Key Changes:
created_atcolumn to Drizzle table schema withdefaultNow()and timezone supportcreated_atfield to Zod schema as nullable and optional to match database behaviorcreated_at: new Date()when creating new rollovers in application codecreatedAtparameter for consistencyThe implementation correctly handles edge cases: existing rollovers retain
NULL, newly created rollovers get timestamped by application code, and rollovers migrated via spread operations preserve their original timestamps or fall back to the database default.Confidence Score: 5/5
Important Files Changed
created_attimestamp column to Drizzle schema and Zod schema - nullable with DB default, properly typedcreated_at: new Date()when constructing new rollovers ingetRolloverUpdatesfunctioncreatedAtparameter with default value ofnew Date()Last reviewed commit: 76d7a28
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!