From fa4b635214225a2dbd7182c3b9fd5b02d2236b1a Mon Sep 17 00:00:00 2001 From: Christian Gendreau Date: Fri, 26 Jul 2024 08:56:57 -0400 Subject: [PATCH] 34361 Avoid drop column in migration if there is content Added precondition to db migration --- ...3-Change_PcrBatchItem_to_use_StorageUnitUsage.xml | 12 +++++++++++- ...44-Change_SeqReaction_to_use_StorageUnitUsage.xml | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/resources/db/changelog/migrations/43-Change_PcrBatchItem_to_use_StorageUnitUsage.xml b/src/main/resources/db/changelog/migrations/43-Change_PcrBatchItem_to_use_StorageUnitUsage.xml index 10809773..e4d4e12b 100644 --- a/src/main/resources/db/changelog/migrations/43-Change_PcrBatchItem_to_use_StorageUnitUsage.xml +++ b/src/main/resources/db/changelog/migrations/43-Change_PcrBatchItem_to_use_StorageUnitUsage.xml @@ -5,11 +5,21 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://local.xsd/dbchangelog-4.4.xsd" objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS"> - + + + + SELECT COUNT(*) + FROM pcr_batch_item + WHERE well_row is NOT NULL + + + Make sure all pcr_batch_item.well_row are null. + + diff --git a/src/main/resources/db/changelog/migrations/44-Change_SeqReaction_to_use_StorageUnitUsage.xml b/src/main/resources/db/changelog/migrations/44-Change_SeqReaction_to_use_StorageUnitUsage.xml index 9f5d8f8a..3da7d859 100644 --- a/src/main/resources/db/changelog/migrations/44-Change_SeqReaction_to_use_StorageUnitUsage.xml +++ b/src/main/resources/db/changelog/migrations/44-Change_SeqReaction_to_use_StorageUnitUsage.xml @@ -5,11 +5,21 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://local.xsd/dbchangelog-4.4.xsd" objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS"> - + + + + SELECT COUNT(*) + FROM seq_reaction + WHERE well_row is NOT NULL + + + Make sure all seq_reaction.well_row are null. + +