-- =============================================
-- 创建故障频次时间记录表
-- 版本: v1.0.2.1
-- =============================================

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'odf_cable_fault_times')
BEGIN
    CREATE TABLE odf_cable_fault_times (
        Id          INT IDENTITY(1,1) PRIMARY KEY,
        FaultId     INT NOT NULL,                       -- 关联故障 odf_cable_faults.Id
        FaultTime   DATETIME NOT NULL,                  -- 故障发生时间
        CreatedAt   DATETIME NOT NULL DEFAULT GETDATE() -- 创建时间
    );
END
GO
