martinjw/dbschemareader

UseGranularBatching does not use 'GO' statement terminations for create index syntax

whibdev opened this issue · 3 comments

When using table.ToSqlCreateTable() with UseGranularBatching option, generated CREATE INDEX statements are not terminated with 'GO'

Example output:

CREATE TABLE dbo.AspNetUsers
(
  Id NVARCHAR (450) NOT NULL,
  UserName NVARCHAR (256),
  NormalizedUserName NVARCHAR (256),
  Email NVARCHAR (256),
  NormalizedEmail NVARCHAR (256),
  EmailConfirmed BIT  NOT NULL,
  PasswordHash NVARCHAR (MAX),
  SecurityStamp NVARCHAR (MAX),
  ConcurrencyStamp NVARCHAR (MAX),
  PhoneNumber NVARCHAR (MAX),
  PhoneNumberConfirmed BIT  NOT NULL,
  TwoFactorEnabled BIT  NOT NULL,
  LockoutEnd DATETIMEOFFSET,
  LockoutEnabled BIT  NOT NULL,
  AccessFailedCount INT  NOT NULL
)
GO

ALTER TABLE dbo.AspNetUsers ADD CONSTRAINT PK_AspNetUsers PRIMARY KEY (Id)
GO

CREATE NONCLUSTERED INDEX EmailIndex ON dbo.AspNetUsers(NormalizedEmail);
CREATE UNIQUE NONCLUSTERED INDEX UserNameIndex ON dbo.AspNetUsers(NormalizedUserName) WHERE ([NormalizedUserName] IS NOT NULL);

Will be fixed in next version.

Will be fixed in next version.
Great! Do you have a timeline on the next release?

Released on nuget now!