Issues
- Release a 3.0.0 Alpha 1 buildNHPG-6Resolved issue: NHPG-6Bill Pierce
- Release a 2.1.2 buildNHPG-5Resolved issue: NHPG-5Bill Pierce
- Make NHPG compatible with .NET 3.5, newer versions of NHibernate and v6 of the Mysql ConnectorNHPG-4Resolved issue: NHPG-4Bill Pierce
- there is a message about "NHibernate.ProxyGenerators.CastleDynamicProxy" assembly.NHPG-3Resolved issue: NHPG-3Bill Pierce
- Add Support for NHibernate.Mapping.AttributesNHPG-2Bill Pierce
- Added dialect option to enable Oracle specific mappingsNHPG-1Resolved issue: NHPG-1Bill Pierce
SchemaExport: include foreign keys in CREATE TABLE (for SQLite)
Description
Environment
Details
Assignee
Patrick EarlPatrick EarlReporter
Matthew Gabeler-LeeMatthew Gabeler-LeeComponents
Affects versions
Priority
TrivialWho's Looking?
Open Who's Looking?
Details
Details
Assignee
Reporter
Components
Affects versions
Priority
Who's Looking?
Activity
Fabio MauloMay 9, 2011 at 9:57 AM
Fixed in revision 5543 by Patrick
Bogdan CosteaOctober 20, 2010 at 4:28 PM
I've run into the same issue.
Looking at it I realized that something is fishy.
It seems that all FK's are added using ALTER's, not inlined in the CREATE TABLE, regardless of dialect.
This is really tricky, because SQLite doesn't support ALTER TABLE ADD CONSTRAINT but it supports FK's in inlined CREATE TABLE... so the problem can't really be fixed in the dialect.
A fixing patch would modify NHibernate.Mapping.Table, NHibernate.Dialect.Dialect and it would mean creating a new SQLite dialect, with a different name, just to be backward compatible.
Modifying NHibernate.Mapping.Table and NHibernate.Dialect.Dialect is required to add support for creating foreign keys in CREATE TABLE.
Would such a patch that covers Table, Dialect and a new SQLite dialect class be accepted?
Asbjørn UlsbergAugust 19, 2010 at 3:57 AM
@Matthew If you know how to create the required parts of the dialect to support foreign keys (in both create and update table statements), perhaps other people in the community (like me) can take that as a basis and somehow make it work. Would it be possible for you to create a patch that provides this functionality? It would be greatly appreciated!
Since newer versions of SQLite support foreign key enforcement, it would be nice if the schema export functionality in NHibernate could generate foreign key clauses when working with the SQLite dialect.
Right now what's stopping this from being a trivial change to the SQLiteDialect class is that NHibernate only creates foreign keys with an ALTER TABLE statement, and SQLite doesn't support that. If NHibernate supported including the foreign keys in the CREATE TABLE statement, then SQLite's foreign key support could be used.