Skip to content

Commit cf0b63c

Browse files
committed
Issue_21: Apply SqliteForeignKeyIndexConvention right after the ForeignKeyIndexConvetion.
1 parent aa636ad commit cf0b63c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

SQLite.CodeFirst/SqliteInitializerBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Data.Entity;
33
using System.Data.Entity.ModelConfiguration.Conventions;
4+
using SQLite.CodeFirst.Convention;
45

56
namespace SQLite.CodeFirst
67
{
@@ -18,6 +19,7 @@ protected SqliteInitializerBase(string connectionString, DbModelBuilder modelBui
1819
// This convention will crash the SQLite Provider before "InitializeDatabase" gets called.
1920
// See https://github.com/msallin/SQLiteCodeFirst/issues/7 for details.
2021
modelBuilder.Conventions.Remove<TimestampAttributeConvention>();
22+
modelBuilder.Conventions.AddAfter<ForeignKeyIndexConvention>(new SqliteForeignKeyIndexConvention());
2123
}
2224

2325
public virtual void InitializeDatabase(TContext context)

0 commit comments

Comments
 (0)