reordered table creations in the migration so that the foreign keys would not be declared before the column they reference is created in other table