-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix migration issue by dropping existing Reviews before schema change (…
- Loading branch information
1 parent
b6cc320
commit 8acf75c
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.16 on 2024-12-19 15:20 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def drop_existing_reviews(apps, schema_editor): | ||
Review = apps.get_model("versions", "Review") | ||
output = Review.objects.all().delete() | ||
print(f"\nDeleted {output}...") | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("versions", "0015_drop_review_generated_stub_users"), | ||
] | ||
operations = [ | ||
migrations.RunPython(drop_existing_reviews, migrations.RunPython.noop), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters