-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
[BUG]: data loss when using timestamp(3) and push
command
#2160
Comments
I encountered this same issue too, my only 'hack' was to set mode to string: createdAt: timestamp("created_at", {precision: 3, mode: 'string' })
.notNull(), which outputs a EDIT: you can temporarily fix this by deleting the space in the template string on this line:
If you compare the function to PgTimestampString you can see there is no whitespace:
For a release, I guess this will need a deeper fix with the push logic to handle / ignore these discrepancies. |
Having the same issue, this occurs with every single Removing the |
Same issue here: #2210 |
Opened a PR w/ @JohnGemstone 's fix: I've also pushed a fixed npm package that can be used temporarily (https://www.npmjs.com/package/@kengoldfarb/drizzle-orm): |
Should be fixed in latest versions of drizzle-kit! Feel free to reopen if it's not fixed for you! |
What version of
drizzle-orm
are you using?0.30.8
What version of
drizzle-kit
are you using?0.20.14
Describe the Bug
When I have the following in my table schema:
when I run
drizzle-kit push:pg
drizzle-kit somehow thinkstimestamp(3)
andtimestamp (3)
are different and causing the table to be truncated:Expected behavior
there shouldn't be data loss
Environment & setup
No response
The text was updated successfully, but these errors were encountered: