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
If you try to create a new Location when running on Postgres, you get an error saying something about violating a not-null constraint. While we don't formally support PostgreSQL, we certainly do like to at least try to make it work when we can.
The workaround we had to do for the validation on parent_id is that we had to explicitly set the id to null in the controller method to create the new Location.
MySQL parses that null as "Do the autoincrement". PostgreSQL seems to parse that null as "Try to insert a null into id" and that fails database-level constraint validation.
We've also been talking about some custom validations that might prevent circular location references, this might be a chance to do that, solving two problems at once. I think we have an in-flight PR that might address it - #8253
The text was updated successfully, but these errors were encountered:
If you try to create a new Location when running on Postgres, you get an error saying something about violating a not-null constraint. While we don't formally support PostgreSQL, we certainly do like to at least try to make it work when we can.
The workaround we had to do for the validation on
parent_id
is that we had to explicitly set theid
tonull
in the controller method to create the new Location.MySQL parses that
null
as "Do the autoincrement". PostgreSQL seems to parse thatnull
as "Try to insert anull
intoid
" and that fails database-level constraint validation.We've also been talking about some custom validations that might prevent circular location references, this might be a chance to do that, solving two problems at once. I think we have an in-flight PR that might address it - #8253
The text was updated successfully, but these errors were encountered: