From 52f5e72b9012e390ede0d754d5db503d6a47e7df Mon Sep 17 00:00:00 2001 From: Omar Selo Date: Wed, 16 Oct 2024 14:16:22 +0000 Subject: [PATCH] Avoid dropping test execution review columns for safety --- ..._create_artefactbuildenvironmentreview_.py | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/backend/migrations/versions/2024_10_02_1114-91e7e3f437a0_create_artefactbuildenvironmentreview_.py b/backend/migrations/versions/2024_10_02_1114-91e7e3f437a0_create_artefactbuildenvironmentreview_.py index d2708fcb..82491009 100644 --- a/backend/migrations/versions/2024_10_02_1114-91e7e3f437a0_create_artefactbuildenvironmentreview_.py +++ b/backend/migrations/versions/2024_10_02_1114-91e7e3f437a0_create_artefactbuildenvironmentreview_.py @@ -85,43 +85,8 @@ def upgrade() -> None: op.execute(copy_cmd) - op.drop_column("test_execution", "review_comment") - op.drop_column("test_execution", "review_decision") - op.execute("DROP TYPE testexecutionreviewdecision") - def downgrade() -> None: - te_review_decision = sa.Enum( - "REJECTED", - "APPROVED_INCONSISTENT_TEST", - "APPROVED_UNSTABLE_PHYSICAL_INFRA", - "APPROVED_FAULTY_HARDWARE", - "APPROVED_CUSTOMER_PREREQUISITE_FAIL", - "APPROVED_ALL_TESTS_PASS", - name="testexecutionreviewdecision", - ) - te_review_decision.create(op.get_bind()) - op.add_column( - "test_execution", - sa.Column( - "review_decision", - postgresql.ARRAY(te_review_decision), - server_default=sa.text("'{}'::testexecutionreviewdecision[]"), - autoincrement=False, - nullable=False, - ), - ) - op.add_column( - "test_execution", - sa.Column( - "review_comment", - sa.VARCHAR(), - server_default=sa.text("''::character varying"), - autoincrement=False, - nullable=False, - ), - ) - op.execute(reverse_copy_cmd) op.drop_table("artefact_build_environment_review")