当前位置: 首页>>代码示例>>C#>>正文


C# DdlGeneratorFactory.RenameTable方法代码示例

本文整理汇总了C#中DatabaseSchemaReader.SqlGen.DdlGeneratorFactory.RenameTable方法的典型用法代码示例。如果您正苦于以下问题:C# DdlGeneratorFactory.RenameTable方法的具体用法?C# DdlGeneratorFactory.RenameTable怎么用?C# DdlGeneratorFactory.RenameTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseSchemaReader.SqlGen.DdlGeneratorFactory的用法示例。


在下文中一共展示了DdlGeneratorFactory.RenameTable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestMySqlWithSchema

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

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            table.Name = "NewOrders";

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

            //assert
            Assert.IsTrue(sql.Contains("RENAME TABLE `dbo`.`OldName` TO `NewOrders`"), "names should be quoted correctly");
        }
开发者ID:shiningrise,项目名称:dbschemareader,代码行数:15,代码来源:MigrationRenameTable.cs

示例2: TestDb2

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

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            table.Name = "NewOrders";

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

            //assert
            Assert.IsTrue(sql.Contains("RENAME TABLE \"dbo\".\"OldName\" TO \"NewOrders\""), "names should be quoted correctly");
        }
开发者ID:shiningrise,项目名称:dbschemareader,代码行数:15,代码来源:MigrationRenameTable.cs

示例3: TestOracleNoSchema

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

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            table.Name = "NewOrders";

            //act
            migration.IncludeSchema = false;
            var sql = migration.RenameTable(table, "OldName");

            //assert
            Assert.IsTrue(sql.Contains("ALTER TABLE \"OldName\" RENAME TO \"NewOrders\""), "names should be quoted correctly");
        }
开发者ID:shiningrise,项目名称:dbschemareader,代码行数:16,代码来源:MigrationRenameTable.cs

示例4: TestSqlServerWithSchema

        public void TestSqlServerWithSchema()
        {

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

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            table.Name = "NewOrders";

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

            //assert
            Assert.IsTrue(sql.Contains("sp_rename '[dbo].[OldName]', '[NewOrders]'"), "names should be quoted correctly");
        }
开发者ID:Petran15,项目名称:dbschemareader,代码行数:16,代码来源:MigrationRenameTable.cs

示例5: TestSqLite

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

            var table = MigrationCommon.CreateTestTable("Orders");
            table.SchemaOwner = "dbo";
            table.Name = "NewOrders";

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

            //assert
            Assert.IsTrue(sql.StartsWith("ALTER TABLE [OldName] RENAME TO [NewOrders]", StringComparison.OrdinalIgnoreCase), "Sqlite rename");
        }
开发者ID:shiningrise,项目名称:dbschemareader,代码行数:15,代码来源:MigrationRenameTable.cs


注:本文中的DatabaseSchemaReader.SqlGen.DdlGeneratorFactory.RenameTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。