jfinkels / flask-restless

NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless.readthedocs.io
GNU Affero General Public License v3.0
1.02k stars 301 forks source link

Deleting Resources will ignore Foreign Key constraints #663

Open jnutz opened 7 years ago

jnutz commented 7 years ago

I have a MySQL server with SQL-Alchemy, then I serve my API with Flask-Restless.

When I send a Delete Resource request to a parent table, it will allow the delete even if another table has a foreign key referencing the deleted row. The same request (on the same setup) is not allowed through other channels (e.g. MySQL Workbench) because Foreign Key Constraints is enabled.

Is it possible to configure flask-restless to throw a similar error?

Thank you.