public void TestMySqlWithSchema()
        {
            //arrange
            var migration = new DdlGeneratorFactory(SqlType.MySql).MigrationGenerator();

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            var column = table.FindColumn("NAME");
            column.Name = "NEWNAME";

            //act
            var sql = migration.RenameColumn(table, column, "OldName");

            //assert
            Assert.IsTrue(sql.Contains("ALTER TABLE `dbo`.`Orders` CHANGE `OldName` `NEWNAME` VARCHAR (10) NOT NULL"), "names should be quoted correctly");
        }
        public void TestDb2()
        {
            //arrange
            var migration = new DdlGeneratorFactory(SqlType.Db2).MigrationGenerator();

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            var column = table.FindColumn("NAME");
            column.Name = "NEWNAME";

            //act
            var sql = migration.RenameColumn(table, column, "OldName");

            //assert
            Assert.IsTrue(sql.Contains("ALTER TABLE \"dbo\".\"Orders\" RENAME COLUMN \"OldName\" TO \"NEWNAME\""), "names should be quoted correctly");
        }
        public void TestSqlServerWithSchema()
        {

            //arrange
            var migration = new DdlGeneratorFactory(SqlType.SqlServer).MigrationGenerator();

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            var column = table.FindColumn("NAME");
            column.Name = "NEWNAME";

            //act
            var sql = migration.RenameColumn(table, column, "OldName");

            //assert
            Assert.IsTrue(sql.Contains("sp_rename '[dbo].[Orders].[OldName]', '[NEWNAME]', 'COLUMN'"), "names should be quoted correctly");
        }
        public void TestSqLite()
        {
            //arrange
            var migration = new DdlGeneratorFactory(SqlType.SQLite).MigrationGenerator();

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            var column = table.FindColumn("NAME");
            column.Name = "NEWNAME";

            //act
            var sql = migration.RenameColumn(table, column, "OldName");

            //assert
            Assert.IsTrue(sql.StartsWith("--", StringComparison.OrdinalIgnoreCase), "Cannot be changed in SQLite");
        }