From: <pa...@us...> - 2011-03-26 00:43:40
|
Revision: 5536 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5536&view=rev Author: patearl Date: 2011-03-26 00:43:34 +0000 (Sat, 26 Mar 2011) Log Message: ----------- Added and partially utilized Dialect.SupportsForeignKeyConstraintInAlterTable property. Need to fill in the "CREATE TABLE" part of the implementation still. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2011-03-25 21:44:28 UTC (rev 5535) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2011-03-26 00:43:34 UTC (rev 5536) @@ -912,7 +912,7 @@ script.Add(index.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); } - if (dialect.HasAlterTable) + if (dialect.SupportsForeignKeyConstraintInAlterTable) { foreach (var fk in table.ForeignKeyIterator) { @@ -2320,7 +2320,7 @@ ITableMetadata tableInfo = databaseMetadata.GetTableMetadata(table.Name, table.Schema, table.Catalog, table.IsQuoted); - if (dialect.HasAlterTable) + if (dialect.SupportsForeignKeyConstraintInAlterTable) { foreach (var fk in table.ForeignKeyIterator) { Modified: trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs 2011-03-25 21:44:28 UTC (rev 5535) +++ trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs 2011-03-26 00:43:34 UTC (rev 5536) @@ -621,6 +621,14 @@ get { return true; } } + /// <summary> + /// Does this dialect support adding foreign key constraints via alter table? If not, it's assumed they can only be added through create table. + /// </summary> + public virtual bool SupportsForeignKeyConstraintInAlterTable + { + get { return HasAlterTable; } + } + /// <summary> /// The syntax used to add a foreign key constraint to a table. /// </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |