You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code was generated by scaffolding an existing PostgresSQL database. I don't think it matters if you use HasDefaultValueSql("250") or HasDefaultValue(250).
When you try to update a PostgresSQL database, you get this error:
42601: multiple default values specified for column "Images_Large" of table "MyTable"
I generated a script using dotnet ef migrations script -o First.sql and loaded it in pgadmin3. The column was scaffolded as such:
"Images_Large"serialNOT NULL DEFAULT (250),
The "Images_Large" column is not the primary key of the database and therefore should not be mapped as serial. I changed the script to:
"Images_Large"integerNOT NULL DEFAULT (250),
And it's fixed.
This also happens to short and byte too.
The text was updated successfully, but these errors were encountered:
I have a model that looks like this:
And it has a default value defined in the
OnModelCreating
of aDbContext
The above code was generated by scaffolding an existing PostgresSQL database. I don't think it matters if you use
HasDefaultValueSql("250")
orHasDefaultValue(250)
.When you try to update a PostgresSQL database, you get this error:
I generated a script using
dotnet ef migrations script -o First.sql
and loaded it in pgadmin3. The column was scaffolded as such:The
"Images_Large"
column is not the primary key of the database and therefore should not be mapped as serial. I changed the script to:And it's fixed.
This also happens to
short
andbyte
too.The text was updated successfully, but these errors were encountered: