protected static DatabaseDefinitions Index_Add_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); var ddWithNewIndex = new TestDatabaseIndex(); ddWithNewIndex.SetVersions(version.GetTypeMapper()); return(new DatabaseDefinitions(ddOriginal, ddWithNewIndex, "TestDatabaseSimple", "TestDatabaseIndex_Index_Add")); }
protected static DatabaseDefinitions Table_Remove_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); AddTable(ddOriginal); var ddWithoutNewTable = new TestDatabaseSimple(); ddWithoutNewTable.SetVersions(version.GetTypeMapper()); return(new DatabaseDefinitions(ddOriginal, ddWithoutNewTable, "TestDatabaseSimple", "TestDatabaseSimple_Table_Remove")); }
protected static DatabaseDefinitions Column_Change_Nullable_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); var ddNullableChanged = new TestDatabaseSimple(); ddNullableChanged.SetVersions(version.GetTypeMapper()); ddNullableChanged.GetTable("Company")["Name"].Type.IsNullable = !ddOriginal.GetTable("Company")["Name"].Type.IsNullable; return(new DatabaseDefinitions(ddOriginal, ddNullableChanged, "TestDatabaseSimple", "TestDatabaseSimple_Column_Change_Nullable")); }
protected static DatabaseDefinitions Column_Remove_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); var ddColumnRemoved = new TestDatabaseSimple(); ddColumnRemoved.SetVersions(version.GetTypeMapper()); ddColumnRemoved.GetTable("Company").Columns.Remove("Name"); return(new DatabaseDefinitions(ddOriginal, ddColumnRemoved, "TestDatabaseSimple", "TestDatabaseSimple_Column_Remove")); }
protected static DatabaseDefinitions Column_Add_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); var ddWithNewColumn = new TestDatabaseSimple(); ddWithNewColumn.SetVersions(version.GetTypeMapper()); ddWithNewColumn.GetTable("Company").AddVarChar("Name2", 100); return(new DatabaseDefinitions(ddOriginal, ddWithNewColumn, "TestDatabaseSimple", "TestDatabaseSimple_Column_Add")); }
protected static DatabaseDefinitions Identity_Change_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); var ddIdentityChanged = new TestDatabaseSimple(); ddIdentityChanged.SetVersions(version.GetTypeMapper()); var identity = ddIdentityChanged.Company.Columns["Id"].Properties.OfType <Identity>().First(); identity.Increment = 2; return(new DatabaseDefinitions(ddOriginal, ddIdentityChanged, "TestDatabaseSimple", "TestDatabaseSimple_Identity_Change")); }
protected static DatabaseDefinitions Column_Change2_Length_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); ddOriginal.GetTable("Company").AddNVarChar("Name2", 100); var ddColumnLengthsChanged = new TestDatabaseSimple(); ddColumnLengthsChanged.SetVersions(version.GetTypeMapper()); ddColumnLengthsChanged.GetTable("Company").AddNVarChar("Name2", 100); ddColumnLengthsChanged.GetTable("Company")["Name"].Type.Length += 1; ddColumnLengthsChanged.GetTable("Company")["Name2"].Type.Length += 1; return(new DatabaseDefinitions(ddOriginal, ddColumnLengthsChanged, "TestDatabaseSimple", "TestDatabaseSimple_Column_Change2_Length")); }
protected static DatabaseDefinitions Column_Change_DbType_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.SetVersions(version.GetTypeMapper()); var ddDbTypeChanged = new TestDatabaseSimple(); ddDbTypeChanged.SetVersions(version.GetTypeMapper()); if (version == MsSqlVersion.MsSql2016) { ddDbTypeChanged.GetTable("Company")["Name"].Type.SqlTypeInfo = MsSqlType2016.NChar; } else if (version == OracleVersion.Oracle12c) { ddDbTypeChanged.GetTable("Company")["Name"].Type.SqlTypeInfo = OracleType12c.NChar; } return(new DatabaseDefinitions(ddOriginal, ddDbTypeChanged, "TestDatabaseSimple", "TestDatabaseSimple_Column_Change_DbType")); }
protected static DatabaseDefinitions Pk_Add_Dds(SqlEngineVersion version) { var ddOriginal = new TestDatabaseSimple(); ddOriginal.GetTable("Company").Columns["Id"].Properties.Remove( ddOriginal.GetTable("Company").Columns["Id"].Properties.OfType <Identity>().First() ); ddOriginal.GetTable("Company").Properties.Remove( ddOriginal.GetTable("Company").Properties.OfType <PrimaryKey>().First() ); ddOriginal.SetVersions(version.GetTypeMapper()); var ddWithPk = new TestDatabaseSimple(); ddWithPk.SetVersions(version.GetTypeMapper()); ddWithPk.GetTable("Company").Columns["Id"].Properties.Remove( ddWithPk.GetTable("Company").Columns["Id"].Properties.OfType <Identity>().First() ); return(new DatabaseDefinitions(ddOriginal, ddWithPk, "TestDatabaseSimple", "TestDatabaseSimple_Pk_Add")); }