Problem publishing database project that has SYSTEM_VERSIONING applied to table with BIGINT primary key

  • Thread starter Thread starter Warren QQ
  • Start date Start date
W

Warren QQ

Guest
Is the any restriction on creating a system-versioned temporal table for a table that has a BIGINT primary key ... or (more likely) is there a bug in VS 2017 database project?

I have a VS 2017 database project with a table definition as follows:
CREATE TABLE [MySchema].[MyTable] (
[ID] BIGINT IDENTITY (1, 1) NOT NULL,
[Title] NVARCHAR (MAX) NULL,
[CreatedDate] DATETIME NOT NULL,
[CreatedBy] INT NOT NULL,
[ModifiedDate] DATETIME NOT NULL,
[ModifiedBy] INT NOT NULL,
[SysStartTime] DATETIME2 (7) GENERATED ALWAYS AS ROW START CONSTRAINT [DF_MyTable_SysStartTime] DEFAULT (sysutcdatetime()) NOT NULL,
[SysEndTime] DATETIME2 (7) GENERATED ALWAYS AS ROW END CONSTRAINT [DF_MyTable_SysEndTime] DEFAULT (CONVERT([datetime2],'9999-12-31 23:59:59.9999999')) NOT NULL,
CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED ([ID] ASC),
PERIOD FOR SYSTEM_TIME ([SysStartTime], [SysEndTime])
)
WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE=[MySchema].[MyTableHistory], DATA_CONSISTENCY_CHECK=ON));

When I publish this project the first time it works fine.

When I publish the project again, the BIGINT field in the temporal table changes to INT ... and it all falls in a heap.

Continue reading...
 
Back
Top