Skip to content

Commit

Permalink
squash me
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisig committed Dec 18, 2024
1 parent 772d1af commit c158b46
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions utils/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ class NotInTestEnvironmentError(Exception):


def drop_and_create_model(model, schema_editor: BaseDatabaseSchemaEditor) -> None:
sql = f"DROP TABLE IF EXISTS {model._meta.db_table} CASCADE;"
for field in model._meta.local_many_to_many:
sql += f"DROP TABLE IF EXISTS {field.remote_field.through._meta.db_table} CASCADE;"
schema_editor.execute(sql)
schema_editor.create_model(model)


Expand Down

0 comments on commit c158b46

Please sign in to comment.