From 553935994996b844946b61f7c7a94dfef742cae6 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 22 Nov 2024 11:23:26 -0800 Subject: [PATCH] fix tests --- .../migrations/0002_delete_model_state.py | 13 +++---------- .../migrations/0003_delete_table.py | 9 ++++----- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0002_delete_model_state.py b/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0002_delete_model_state.py index aa7a0b3105125..4d9779f1c977f 100644 --- a/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0002_delete_model_state.py +++ b/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0002_delete_model_state.py @@ -1,8 +1,7 @@ # Generated by Django 3.1 on 2019-09-22 21:47 - -from django.db import migrations - from sentry.new_migrations.migrations import CheckedMigration +from sentry.new_migrations.monkey.models import SafeDeleteModel +from sentry.new_migrations.monkey.state import DeletionAction class Migration(CheckedMigration): @@ -12,11 +11,5 @@ class Migration(CheckedMigration): ] operations = [ - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.DeleteModel( - name="TestTable", - ), - ] - ) + SafeDeleteModel(name="TestTable", deletion_action=DeletionAction.MOVE_TO_PENDING), ] diff --git a/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0003_delete_table.py b/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0003_delete_table.py index f0a85b49040a3..8a6e05080a31b 100644 --- a/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0003_delete_table.py +++ b/fixtures/safe_migrations_apps/good_flow_delete_model_state_app/migrations/0003_delete_table.py @@ -1,16 +1,15 @@ # Generated by Django 3.1 on 2019-09-22 21:47 - -from django.db import migrations - from sentry.new_migrations.migrations import CheckedMigration +from sentry.new_migrations.monkey.models import SafeDeleteModel +from sentry.new_migrations.monkey.state import DeletionAction class Migration(CheckedMigration): dependencies = [ - ("good_flow_delete_model_state_app", "0001_initial"), + ("good_flow_delete_model_state_app", "0002_delete_model_state"), ] operations = [ - migrations.RunSQL('DROP TABLE "good_flow_delete_model_state_app_testtable";'), + SafeDeleteModel(name="TestTable", deletion_action=DeletionAction.DELETE), ]