You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migration 0002 in OI app causes db clearing to not work, by breaking the python manage.py flush command (and by extension: ./easytoolbox.py flush-db), which is needed for running cypress tests locally.
This migration removes Region and OIOnsiteRegistration models from the OI app, but does not delete their tables from the database (migrations.SeparateDatabaseAndState). Said tables contain non-nullable foreign key fields to other tables, causing an error when trying to clear the db, as Django only clears tables related to existing objects.
Depending on whether deleting these tables is acceptable, I found two possible solutions:
If we can't delete the tables, we can make the foreign key fields nullable:
Migration 0002 in OI app causes db clearing to not work, by breaking the
python manage.py flush
command (and by extension:./easytoolbox.py flush-db
), which is needed for running cypress tests locally.File: https://github.com/sio2project/oioioi/blob/c3c399b02312dc1420aa43b474b9c01d10e9463e/oioioi/oi/migrations/0002_auto_20160412_1720.py
This migration removes Region and OIOnsiteRegistration models from the OI app, but does not delete their tables from the database (
migrations.SeparateDatabaseAndState
). Said tables contain non-nullable foreign key fields to other tables, causing an error when trying to clear the db, as Django only clears tables related to existing objects.Depending on whether deleting these tables is acceptable, I found two possible solutions:
Both solutions fix the issue and pass all tests (as of 19.03.2024 / commit 056caf6).
The text was updated successfully, but these errors were encountered: