LONG POST: Problem publishing database project with BIGINT column in FK relationship in table with SYSTEM_VERSIONING enabled

  • 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 definitions as below.
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.

CREATE TABLE dbo.PriceList (
ID BIGINT NOT NULL CONSTRAINT PK_PriceList PRIMARY KEY
, DrinkName NVARCHAR(256) NOT NULL
, IsAlcoholic BIT NOT NULL
, Price MONEY
, Discount DECIMAL (3,1)
, ValidFrom DATETIME2 GENERATED ALWAYS AS ROW START NOT NULL
, ValidTo DATETIME2 GENERATED ALWAYS AS ROW END NOT NULL
, PERIOD FOR SYSTEM_TIME (ValidFrom, ValidTo)
) WITH (SYSTEM_VERSIONING = ON(HISTORY_TABLE = dbo.PriceListHistory));


CREATE TABLE [dbo].[Dependencies] (
[ID] BIGINT IDENTITY (1, 1) NOT NULL,
[PriceID] BIGINT NOT NULL,
[ModifiedDate] DATETIME NOT NULL,
[ModifiedBy] INT NOT NULL,
[SysStartTime] DATETIME2 (7) GENERATED ALWAYS AS ROW START CONSTRAINT [DF_Dependencies_SysStartTime] DEFAULT (SYSUTCDATETIME()) NOT NULL,
[SysEndTime] DATETIME2 (7) GENERATED ALWAYS AS ROW END CONSTRAINT [DF_Dependencies_SysEndTime] DEFAULT (CONVERT([DATETIME2],'9999-12-31 23:59:59.9999999')) NOT NULL,
Discount DECIMAL (3,1),

[IDText] VARCHAR (255) NULL,
[Title] VARCHAR (MAX) NULL,
[Title2] VARCHAR (MAX) NULL,
[Title3] VARCHAR (MAX) NULL,
[Title4] VARCHAR (MAX) NULL,
[DateRequired] DATETIME NULL,
[DateReceived] DATETIME NULL,
[DateReturned] DATETIME NULL,
[Description] VARCHAR (MAX) NULL,
[TypeOf] VARCHAR (MAX) NULL,
[StatusID] INT NULL,
[IDAssetNumber] VARCHAR (255) NULL,
[DeliveryPersonResponsibleUserID] INT NULL,
[OutputPackageID] BIGINT NULL,
[CustomerPersonResponsibleUserID] INT NULL,
[OriginalID] VARCHAR (255) NULL,
[SendMODSignatureStamp] DATETIME NULL,
[SendMODDependencySignatureUserID] INT NULL,
[ReceiveBackMODSignatureResponseAccept] VARCHAR (MAX) NULL,
[SendMODSignatureResponseReject] VARCHAR (MAX) NULL,
[ReceiveBackMODSignatureStamp] DATETIME NULL,
[ReceiveBackMODSignatureResponseReject] VARCHAR (MAX) NULL,
[AcceptDelSignatureStamp] DATETIME NULL,
[AcceptDependencySignatureUserID] INT NULL,
[AcceptDelSignatureResponseAccept] VARCHAR (MAX) NULL,
[AcceptDelSignatureResponseReject] VARCHAR (MAX) NULL,
[SendBackDelSignatureResponseAccept] VARCHAR (MAX) NULL,
[SendBackDelSignatureStamp] DATETIME NULL,
[SendBackDependencySignatureUserID] INT NULL,
[SendBackDelSignatureResponseReject] VARCHAR (MAX) NULL,
[SendMODSignatureResponseAccept] VARCHAR (MAX) NULL,
[ReceiveBackMODDependencySignatureUserID] INT NULL,
[RemovedByChange] VARCHAR (255) NULL,
[AddedbyChange] VARCHAR (255) NULL,
[CSQScore] VARCHAR (255) NULL,
[KeyfieldID] BIGINT NOT NULL,
...orum=visualstudiogeneral"]Continue reading...
 
Back
Top