COSC481W-2022Winter / capstone-hackmcx

capstone-hackmcx created by GitHub Classroom
0 stars 1 forks source link

DB Migration Race Condition #26

Closed 3dxp closed 2 years ago

3dxp commented 2 years ago

The DB migration will not run successfully because the callback that creates the database instance will not wait for the operation to complete causing migrations to fail.

To reproduce just run the migrations without the schema added and it will fail.

The work around is to run the api with the migration flag twice. The second time the schema will be present and migrations will succeed unless the non-default DB_NAME of app was used.