Skip to content

Commit ed3c1c5

Browse files
authored
fix forward-only changes + indirect changes should still cause the recreation
1 parent 53969db commit ed3c1c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sqlmesh/core/snapshot/evaluator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
SnapshotIdBatch,
6767
SnapshotInfoLike,
6868
SnapshotTableCleanupTask,
69+
SnapshotChangeCategory,
6970
)
7071
from sqlmesh.core.snapshot.execution_tracker import QueryExecutionTracker
7172
from sqlmesh.utils import random_id, CorrelationId, AttributeDict
@@ -2762,9 +2763,10 @@ def migrate(
27622763
logger.info("Migrating view '%s'", target_table_name)
27632764
# Optimization: avoid unnecessary recreation when possible
27642765
if (
2765-
snapshot.model.forward_only
2766+
snapshot.is_forward_only
27662767
or bool(snapshot.model.physical_version)
27672768
or not snapshot.virtual_environment_mode.is_full
2769+
or snapshot.change_category == SnapshotChangeCategory.INDIRECT_NON_BREAKING
27682770
or not self.adapter.COMMENT_CREATION_VIEW.is_unsupported
27692771
):
27702772
model = snapshot.model

0 commit comments

Comments
 (0)