We've got a nice abstract query system but our table creation and migrations are horrible. We re-write them for multiple database engines. And as a result extensions need to do the same and often don't. Leading to things being a mess for databases other than MySQL.
While I was doing the sites stuff a syntax for defining tables came to mind and I wrote out an RfC for a method of defining our database abstractly.
https://www.mediawiki.org/wiki/Requests_for_comment/Abstract_table_definitio...