Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSchema generation: Nullable<Timestamp> instead of Nullable<Timestamptz> #1767
Comments
gnunicorn
changed the title from
Schemageneration: Nullable<Timestamp> created instead of Nullable<Timestamptz>
to
Schema generation: Nullable<Timestamp> instead of Nullable<Timestamptz>
Jun 27, 2018
This comment has been minimized.
|
Schema inference is doing the right thing. Your column is of type |
sgrif
closed this
Jun 27, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gnunicorn commentedJun 27, 2018
•
edited
Setup
Versions
Feature Flags
["postgres","chrono","serde_json", "r2d2" , "uuid"]Problem Description
Schema generation detects and writes
Nullable<Timestamp>, where it should beNullable<Timestamptz>.What are you trying to accomplish?
I am trying to query/update null-able Timestamp columns on postgres.
What is the expected output?
I expect
cargo runto work with the diesel-generated schema.What is the actual output?
when I do
cargo runit fails with:on my queries.
Steps to reproduce
I have the schema as follows (excerpt) - most important here is the
last_seen_atentry:running
diesel migrate run, this creates the proper schema in my Postgresql, however it also creates the following schema file entry:Fixes
It took me a while to figure out, but I am able to fix this by replacing
TimestampwithTimestamptzin the schema file. Then everything works as expected. This works:Therefore I am assuming this is caused by a fault in the detection/generation.
Unfortunately I have to remember to do that every time I did a
diesel migration run(orredo), which makes this a little annoying.Checklist
closed if this is not the case)