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 upInsertable should allow Option on non null fields with default #554
Comments
This comment has been minimized.
|
We talked on Gitter about this: logs. |
This comment has been minimized.
|
Hm... I feel like this used to work in the past. It definitely is meant to work (with or without a default being present, which we currently don't/can't verify) |
added a commit
that referenced
this issue
Jan 4, 2017
sgrif
referenced this issue
Jan 4, 2017
Merged
Allow inserting `Option<T>` into columns where the type is not nullable #567
sgrif
closed this
in
#567
Jan 4, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mackeyja92 commentedDec 27, 2016
•
edited
The
Insertabletrait currently does not allow fields that are specified asNOT NULLin the database but with aDEFAULTto haveOptiondefined in the model.For example, this model here would fail when using a postgres backend even though the database will automatically fill in the field.
With the SQL definition of this
The above SQL generates the following schema with the field being
NOT NULLand having aDEFAULT.This should work not only for PKs but also any field that has a default in the schema.