The trouble with this would be that the forum software can always only use the features that are supported by all database backends unless there is a way to emulate the behavior for the remainder of the backends.
I guess most database backends nowadays support some sort of referential integrity by using foreign keys, but the handling may be different, which would need to be covered. So you would need to review not only mysql, postgres and mariadb, but also sqlite, sqlite3, mssql and oracle. I am not sure whether sqlite (aka sqlite 2) even supports this, I think this was introduced somewhere in sqlite3.
I do see the benefits of this approach for several applications:
- Conversion from another forum software to phpBB should no longer cause invalid database entries with posts not belonging to any topics, topics not in any forum, PMs that are in no users folder, post references not actually pointing to a post or things like that. This would have saved me a lot of headaches in the past.
- The database itself can take care of deletion of entries in several tables if the referenced element gets deleted. Thus, less SQL queries and no more accidentally forgotten entries in the db. Alternatively, one could forbid deletion if referenced objects are still there, in which case this acts somewhat as a debugging tool. This should help developers and extension developers alike if they use this correctly.
- The database relations are explicitly clarified in the database structure.
Getting back at your change to the dbal: Since this is a feature of the database itself, I think you would mainly have to adjust the table creation and change process, not the every day interaction with the database. SQL selects, updates, inserts and deletes would still function the same way, except that the database will check for restrictions on the inserts and deletes.
I am not sure where you are going with your other points, though. phpBB has had a security audit and enforces its coding guidelines as well for every change that is made to the core. It uses unit tests and functional tests to prevent degradation of the code and every change is reviewed by someone else from the development team before it is merged into the core. I also don't know what parameters you want to "add". References between the tables are of course already present, the only difference is that no foreign key constraints are set. So for everyday database interaction of the forum, you shouldn't even notice the change, only additional constraints should be necessary.