Skip to content

Commit

Permalink
Use SeparateDabaseAndState
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Nov 11, 2024
1 parent 93b49a3 commit bfed647
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunPython(replace_language_with_default_language, revert_default_language),
migrations.AlterField(
model_name="assignment",
name="language_details",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="assignment_set",
to="assignments.language",
),
migrations.SeparateDatabaseAndState(
database_operations=[
migrations.RunPython(replace_language_with_default_language, revert_default_language),
],
state_operations=[
migrations.AlterField(
model_name="assignment",
name="language_details",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="assignment_set",
to="assignments.language",
),
),
]
),
]
16 changes: 11 additions & 5 deletions tin/apps/venvs/migrations/0007_alter_venv_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunPython(venv_default_to_python310, delete_python_310_from_venvs),
migrations.AlterField(
model_name='venv',
name='language',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='venv_set', to='assignments.language'),
migrations.SeparateDatabaseAndState(
database_operations = [
migrations.RunPython(venv_default_to_python310, delete_python_310_from_venvs),
],
state_operations = [
migrations.AlterField(
model_name='venv',
name='language',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='venv_set', to='assignments.language'),
),
],
),
]

0 comments on commit bfed647

Please sign in to comment.