-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Nullable<Varchar>
generated instead of Varchar
#4319
Comments
I cannot reproduce this locally. Additionally diesel does "only" query the database to get information whether or not a column is nullable. So if your schema.rs file says that the column is nullable the database considers it to be nullable. You should be able to verify this by using the following query: SELECT "information_schema"."columns"."column_name", "information_schema"."columns"."udt_name", "information_schema"."columns"."udt_schema", "information_schema"."columns"."is_nullable", "information_schema"."columns"."character_maximum_length", col_description('users'::regclass, "information_schema"."columns"."ordinal_position") FROM "information_schema"."columns" WHERE (("information_schema"."columns"."table_name" = 'users') AND ("information_schema"."columns"."table_schema" = 'public')) ORDER BY "information_schema"."columns"."ordinal_position" Please provide the output of that query for further debugging, otherwise this issue will likely be closed as cannot reproduce. |
Try deleting the schema.rs file. Then run that diesel command again and you'll see it get regenerated. It has And to answer your question:
|
Thanks for providing the output of that query. This output clearly shows that the database allows nullable values for these columns. Both variants are not an issue in diesel, so I will close this issue now. |
Setup
Versions
Feature Flags
Problem Description
What are you trying to accomplish?
What is the expected output?
schema.rs
ofWhat is the actual output?
schema.rs
ofAre you seeing any additional errors?
No
Steps to reproduce
https://github.com/offscale/rust-actix-diesel-auth-scaffold/tree/2f01d2b
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: