public void Create_Index_Has_Online_Disabled_When_Edition_Set_To_Standard() { const string scriptFile = @".\script.sql"; DacpacDeploy.Deploy(@"..\..\..\TestDacpacDeploy\bin\Debug\TestDacpacDeploy.dacpac", Database.server_name, Database.db_name, scriptFile, "EditionAwareCreateIndexForceEdition=Standard"); var script = File.ReadAllText(scriptFile); Console.WriteLine(script); Assert.IsTrue(script.Contains(@"CREATE NONCLUSTERED INDEX [ix_on_or_offline] ON [dbo].[CreateIndexTable]([Name] ASC) GO")); }
public void Insert_Is_Changed_To_Batched_Insert() { const string scriptFile = @".\script.sql"; DacpacDeploy.Deploy(@"..\..\..\TestDacpacDeploy\bin\Debug\TestDacpacDeploy.dacpac", Database.server_name, Database.db_name, scriptFile); var script = File.ReadAllText(scriptFile); Console.WriteLine(script); Assert.IsTrue(script.Contains(@"WHILE (SELECT count(*) FROM [dbo].[ForcedTableMigration]) > 0 BEGIN WITH to_delete AS (SELECT TOP 1480 [count] FROM [dbo].[ForcedTableMigration]) DELETE to_delete OUTPUT deleted.* INTO [dbo].[tmp_ms_xx_ForcedTableMigration] ([count]); END END")); }
public void Create_Index_Is_Wrapped_In_Edition_Check() { const string scriptFile = @".\script.sql"; DacpacDeploy.Deploy(@"..\..\..\TestDacpacDeploy\bin\Debug\TestDacpacDeploy.dacpac", Database.server_name, Database.db_name, scriptFile); var script = File.ReadAllText(scriptFile); Console.WriteLine(script); Assert.IsTrue(script.Contains(@"IF (SELECT * FROM (SELECT @@version AS v) AS edition WHERE v LIKE '%Enterprise%') IS NOT NULL BEGIN CREATE NONCLUSTERED INDEX [ix_on_or_offline] ON [dbo].[CreateIndexTable]([Name] ASC) WITH (ONLINE = ON); END ELSE BEGIN CREATE NONCLUSTERED INDEX [ix_on_or_offline] ON [dbo].[CreateIndexTable]([Name] ASC); END GO")); }
public void When_Parameter_Default_Remoced() { var messages = DacpacDeploy.Deploy(@"..\..\..\TestDacpacDeploy\bin\Debug\TestDacpacDeploy.dacpac", Database.server_name, Database.db_name); Assert.IsTrue(messages.Contains(@"StopDeploymentsOnBreakingProcedureChanges: The procedure [dbo].[TestoRemoveParameter] has had a parameter removed, parameter name: [dbo].[TestoRemoveParameter].[@jj]")); }
public void When_Parameter_Add_With_No_Default() { var messages = DacpacDeploy.Deploy(@"..\..\..\TestDacpacDeploy\bin\Debug\TestDacpacDeploy.dacpac", Database.server_name, Database.db_name); Assert.IsTrue(messages.Contains(@"StopDeploymentsOnBreakingProcedureChanges: The procedure [dbo].[TestoAddParameterNoDefault] has had an additional parameter but no default, parameter name: [dbo].[TestoAddParameterNoDefault].[@b]")); }