Skip to content
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

Create Location fails on PostgreSQL #8926

Closed
uberbrady opened this issue Dec 18, 2020 · 0 comments
Closed

Create Location fails on PostgreSQL #8926

uberbrady opened this issue Dec 18, 2020 · 0 comments
Assignees

Comments

@uberbrady
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant