CREATE TABLE [Tzdb].[Intervals]
(
[Id] [int] NOT NULL IDENTITY(1, 1),
[ZoneId] [int] NOT NULL,
[UtcStart] [datetime2] (0) NOT NULL,
[UtcEnd] [datetime2] (0) NOT NULL,
[LocalStart] [datetime2] (0) NOT NULL,
[LocalEnd] [datetime2] (0) NOT NULL,
[OffsetMinutes] [smallint] NOT NULL,
[Abbreviation] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [Tzdb].[Intervals] ADD CONSTRAINT [PK_Intervals] PRIMARY KEY NONCLUSTERED ([Id]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Intervals_Local] ON [Tzdb].[Intervals] ([ZoneId], [LocalStart], [LocalEnd], [UtcStart]) INCLUDE ([Abbreviation], [OffsetMinutes]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Intervals_Utc] ON [Tzdb].[Intervals] ([ZoneId], [UtcStart], [UtcEnd]) INCLUDE ([Abbreviation], [OffsetMinutes]) ON [PRIMARY]
GO
ALTER TABLE [Tzdb].[Intervals] ADD CONSTRAINT [FK_Intervals_Zones] FOREIGN KEY ([ZoneId]) REFERENCES [Tzdb].[Zones] ([Id])
GO