move contrainst to the and of migration steps to ensure that all tables are created before being referenced