本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}