Permalink
Browse files

[Contrib][T4][SQL Server] Fix ForeignKey order definition

  • Loading branch information...
1 parent 0709d10 commit b6cb12d4dfddc3981279008131f90965a0386a92 @spaccabit committed Nov 19, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/FluentMigrator.T4/SchemaReaders/SqlServerSchemaReader.cs
@@ -335,7 +335,8 @@ FROM INFORMATION_SCHEMA.COLUMNS
WHERE
(FK.CONSTRAINT_TYPE = 'FOREIGN KEY')
AND (FK.TABLE_NAME=@tableName)
- AND (FK.TABLE_SCHEMA=@schemaName)";
+ AND (FK.TABLE_SCHEMA=@schemaName)
+ ORDER BY ForeignConstraintName, ForeignTableSchema, ForeignTable, FKC.ORDINAL_POSITION";
}
public static class DbDataReaderExtensions

0 comments on commit b6cb12d

Please sign in to comment.