I am trying to create a simple database application that tracks loans of various types of equipment using Fluent NHibernate and SQLite. However, when I try to create a database structure using SchemaExportfor use in unit testing, foreign keys for one-to-many relationships are not created.
Here is my object Equipment:
public virtual int Id { get; set; }
public virtual EquipmentType Type { get; set; }
public virtual int StockId { get; set; }
And here are my comparisons for Equipment:
Id(x => x.Id);
References(x => x.Type);
Map(x => x.StockId);
SQL is generated correctly, except for the absence of foreign keys:
create table "Equipment" (
Id integer,
StockId INTEGER,
Type_id INTEGER,
primary key (Id)
)
Is it possible to SchemaExportgenerate foreign keys when using a SQLite database?
Thank.
user153498