コード例 #1
0
ファイル: Create_Index.cs プロジェクト: vborwork/Contributors
        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"));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
ファイル: Create_Index.cs プロジェクト: vborwork/Contributors
        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"));
        }
コード例 #4
0
ファイル: Stop_Deploy.cs プロジェクト: vborwork/Contributors
        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]"));
        }
コード例 #5
0
ファイル: Stop_Deploy.cs プロジェクト: vborwork/Contributors
        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]"));
        }