public static ITransformationProvider AddManyToManyJoiningTable(this ITransformationProvider database, string schema, string lhsTableName, string lhsKey, string rhsTableName, string rhsKey, string joiningTableName) { string joiningTableWithSchema = TransformationProviderUtility.FormatTableName(schema, joiningTableName); string joinLhsKey = Inflector.Singularize(lhsTableName) + "Id"; string joinRhsKey = Inflector.Singularize(rhsTableName) + "Id"; database.AddTable(joiningTableWithSchema, new Column(joinLhsKey, DbType.Guid, ColumnProperty.NotNull), new Column(joinRhsKey, DbType.Guid, ColumnProperty.NotNull)); string pkName = "PK_" + joiningTableName; pkName = ShortenKeyNameToBeSuitableForOracle(pkName); database.AddPrimaryKey(pkName, joiningTableWithSchema, joinLhsKey, joinRhsKey); string lhsTableNameWithSchema = TransformationProviderUtility.FormatTableName(schema, lhsTableName); string rhsTableNameWithSchema = TransformationProviderUtility.FormatTableName(schema, rhsTableName); string lhsFkName = TransformationProviderUtility.CreateForeignKeyName(lhsTableName, joiningTableName); database.AddForeignKey(lhsFkName, joiningTableWithSchema, joinLhsKey, lhsTableNameWithSchema, lhsKey, ForeignKeyConstraintType.NoAction); string rhsFkName = TransformationProviderUtility.CreateForeignKeyName(rhsTableName, joiningTableName); database.AddForeignKey(rhsFkName, joiningTableWithSchema, joinRhsKey, rhsTableNameWithSchema, rhsKey, ForeignKeyConstraintType.NoAction); return(database); }