SET QUOTED_IDENTIFIER ON
GO

-- =====================================================================
-- Drop dead MILL.Cobbles table.
-- The cobble flag lives on MILL.Billets.IsGood = 0 (set by
-- MILL.TrackCobblesWithCobbleSignalAndShear); no SP reads/writes this
-- table, and the legacy RFAC.Cobbles is empty too (confirmed 2026-05-20).
-- =====================================================================
IF OBJECT_ID('[MILL].[Cobbles]', 'U') IS NOT NULL
    DROP TABLE [MILL].[Cobbles];
GO

-- =====================================================================
-- Drop dead cobble objects removed from the project.
-- MILL.TrackCobblesOnStop never ran (its EXEC was commented out in legacy
-- TrackDelays, never JM-registered) and MILL.GetShearSignalForCobblesDetectionTagId
-- was its only caller. Both were deleted from the repo; drop them from the
-- DB so a deploy over an existing database cleans up the orphans.
-- =====================================================================
IF OBJECT_ID('[MILL].[TrackCobblesOnStop]', 'P') IS NOT NULL
    DROP PROCEDURE [MILL].[TrackCobblesOnStop];
GO

IF OBJECT_ID('[MILL].[GetShearSignalForCobblesDetectionTagId]', 'FN') IS NOT NULL
    DROP FUNCTION [MILL].[GetShearSignalForCobblesDetectionTagId];
GO
