From 67f0f172875e1219d7765755a720fe042af92f29 Mon Sep 17 00:00:00 2001 From: Edward Gao Date: Wed, 14 Feb 2024 14:30:12 -0800 Subject: [PATCH] utility method --- .../typing_deduping/migrators/Migration.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/airbyte-cdk/java/airbyte-cdk/typing-deduping/src/main/java/io/airbyte/integrations/base/destination/typing_deduping/migrators/Migration.kt b/airbyte-cdk/java/airbyte-cdk/typing-deduping/src/main/java/io/airbyte/integrations/base/destination/typing_deduping/migrators/Migration.kt index fa8f73dfe48a..fd8a442b584e 100644 --- a/airbyte-cdk/java/airbyte-cdk/typing-deduping/src/main/java/io/airbyte/integrations/base/destination/typing_deduping/migrators/Migration.kt +++ b/airbyte-cdk/java/airbyte-cdk/typing-deduping/src/main/java/io/airbyte/integrations/base/destination/typing_deduping/migrators/Migration.kt @@ -35,5 +35,14 @@ interface Migration { */ fun migrateIfNecessary(state: State, stream: StreamConfig): MigrationResult - data class MigrationResult(val updatedState: State, val softReset: Boolean) + data class MigrationResult(val updatedState: State, val softReset: Boolean) { + companion object { + /** + * If a migration detects no need to migrate, it should return this. + */ + fun noop(updatedState: State): MigrationResult { + return MigrationResult(updatedState, false) + } + } + } }