Open
Description
Describe the question
I'm trying to create a foreign key to a composite primary key for SQLite as shown below:
CREATE TABLE Area(
ArticleId TEXT NOT NULL,
AreaGroupIndex INTEGER NOT NULL,
"Index" INTEGER NOT NULL,
PRIMARY KEY(ArticleId, AreaGroupIndex, "Index"),
FOREIGN KEY(ArticleId, AreaGroupIndex) REFERENCES AreaGroup(ArticleId, "Index") ON DELETE CASCADE
)
The issue is that SQLite allows foreign key creation only as part of a CREATE TABLE
statement as shown above, and I cannot figure out how to do this with FluentMigrator's fluent syntax or whether it is possible at all (I searched the issues here and the answer seems to be 'no'?)
Expected benefit
I can of course create my tables with Execute.Sql
, but I'd really prefer if it was possible with fluent syntax. We make use of fluent syntax to basically reuse fragments of SQL code, and we lose that ability whenever we write raw SQL.
Information (please complete the following information):
- FluentMigrator 7.1
Metadata
Metadata
Assignees
Labels
No labels