Fix MySQL and PostgreSQL. More DB schema refactoring