cleaned up database migrations

- added foreign keys support where necessary