diff --git a/cmd/consolidate-kandang-to-farm-stocks/main.go b/cmd/consolidate-kandang-to-farm-stocks/main.go index b146a32b..acf5b4ba 100644 --- a/cmd/consolidate-kandang-to-farm-stocks/main.go +++ b/cmd/consolidate-kandang-to-farm-stocks/main.go @@ -314,7 +314,8 @@ func buildReferencePlan(ctx context.Context, db *gorm.DB) (*referencePlan, error } func runPrechecks(ctx context.Context, db *gorm.DB, rows []consolidateRow, refs *referencePlan, opts *options) error { - if !opts.SkipBlockedRefsCheck { + // Only check blocked references if we're actually deleting the warehouses + if opts.DeleteKandangWarehouses && !opts.SkipBlockedRefsCheck { if err := ensureNoBlockedWarehouseRefsConsolidate(ctx, db, rows, refs.BlockedWarehouseRefs); err != nil { return err }