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
Zero precision in timestamp/datetime #4784 #4786
Zero precision in timestamp/datetime #4784 #4786
Conversation
OlivierCavadenti
commented
Oct 30, 2021
- Fixes Can's set zero precision to timestamp #4784
- Remove duplicate (actually timestamp == datetime implementation in PG) and so correct datetime precision = 0 too.
@@ -72,22 +72,13 @@ class ColumnCompiler_PG extends ColumnCompiler { | |||
useTz = !withoutTz; | |||
} | |||
useTz = typeof useTz === 'boolean' ? useTz : true; | |||
precision = precision ? '(' + precision + ')' : ''; | |||
precision = precision !== undefined ? '(' + precision + ')' : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also check for null here?
precision = precision ? '(' + precision + ')' : ''; | ||
|
||
return `${useTz ? 'timestamptz' : 'timestamp'}${precision}`; | ||
return this.datetime(withoutTz, precision); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch!
@OlivierCavadenti If you think we need to release it as a hotfix, we should also backport it to 0.95 branch. |
yes we can. do you have any conventation (naming, ...) to make the backport ? |
@OlivierCavadenti I don't think we have one. Also feel free to merge approved PRs at your convenience! |