#2356 - Support referential integrity via foreign key constraints

Identifier #2356
Issue type Feature request or suggestion
Title Support referential integrity via foreign key constraints
Status Open
Tags

Risk: Large database change (custom)

Roadmap: Over the horizon (custom)

Roadmap: v11 partial implementation (custom)

Handling member Deleted
Addon core_database_drivers
Description We have not supported foreign keys because MyISAM has been the main DB engine, and it doesn't support them.

We do have some code to generate the foreign key constraints.

Support applying this if the DB engine supports it, via a major overhaul of our database code.

The constraints would need to be declared within create_table calls rather than in a separate mapping array as is done now. We'd want to remove that mapping array and anything accessing it would query via a new layer that can query the DB structure better.

A lot of code would need cleaning up to delete things in the right order.

There's code to do an InnoDB export of the database schema, for creating entity diagrams. Remove this and make sure the standard DB code can generate this SQL using inbuilt foreign key constraints.
Steps to reproduce

Additional information This may be an absolutely enormous thing to do, and of limited value. But I wanted to get it down here.
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated