Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20176/NHibernate/Mapping
Modified Files:
Constraint.cs ForeignKey.cs PrimaryKey.cs UniqueKey.cs
Log Message:
NH-173: modify how ddl is generated for MySql 4.1+
Index: PrimaryKey.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PrimaryKey.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PrimaryKey.cs 2 Jan 2005 22:03:39 -0000 1.7
--- PrimaryKey.cs 9 Feb 2005 03:09:39 -0000 1.8
***************
*** 57,60 ****
--- 57,75 ----
return buf.Append( StringHelper.ClosedParen ).ToString();
}
+
+ #region IRelationalModel Members
+
+ /// <summary>
+ /// Get the SQL string to drop this Constraint in the database.
+ /// </summary>
+ /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param>
+ /// <returns>
+ /// A string that contains the SQL to drop this Constraint.
+ /// </returns>
+ public override string SqlDropString(NHibernate.Dialect.Dialect dialect)
+ {
+ return "alter table " + Table.GetQualifiedName( dialect ) + dialect.GetDropPrimaryKeyConstraintString( Name );
+ }
+ #endregion
}
}
\ No newline at end of file
Index: Constraint.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Constraint.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Constraint.cs 2 Jan 2005 22:03:39 -0000 1.6
--- Constraint.cs 9 Feb 2005 03:09:38 -0000 1.7
***************
*** 80,84 ****
/// A string that contains the SQL to drop this Constraint.
/// </returns>
! public string SqlDropString( Dialect.Dialect dialect )
{
return "alter table " + Table.GetQualifiedName( dialect ) + " drop constraint " + Name;
--- 80,84 ----
/// A string that contains the SQL to drop this Constraint.
/// </returns>
! public virtual string SqlDropString( Dialect.Dialect dialect )
{
return "alter table " + Table.GetQualifiedName( dialect ) + " drop constraint " + Name;
Index: ForeignKey.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/ForeignKey.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ForeignKey.cs 2 Jan 2005 22:03:39 -0000 1.7
--- ForeignKey.cs 9 Feb 2005 03:09:39 -0000 1.8
***************
*** 89,92 ****
--- 89,108 ----
set { referencedClass = value; }
}
+
+ #region IRelationalModel Memebers
+
+ /// <summary>
+ /// Get the SQL string to drop this Constraint in the database.
+ /// </summary>
+ /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param>
+ /// <returns>
+ /// A string that contains the SQL to drop this Constraint.
+ /// </returns>
+ public override string SqlDropString(NHibernate.Dialect.Dialect dialect)
+ {
+ return "alter table " + Table.GetQualifiedName( dialect ) + dialect.GetDropForeignKeyConstraintString( Name );
+ }
+
+ #endregion
}
}
\ No newline at end of file
Index: UniqueKey.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/UniqueKey.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** UniqueKey.cs 6 Jan 2005 14:19:59 -0000 1.7
--- UniqueKey.cs 9 Feb 2005 03:09:39 -0000 1.8
***************
*** 66,69 ****
--- 66,85 ----
return StringHelper.Replace( buf.Append( StringHelper.ClosedParen ).ToString(), "primary key", "unique" );
}
+
+ #region IRelationalModel Members
+
+ /// <summary>
+ /// Get the SQL string to drop this Constraint in the database.
+ /// </summary>
+ /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param>
+ /// <returns>
+ /// A string that contains the SQL to drop this Constraint.
+ /// </returns>
+ public override string SqlDropString(NHibernate.Dialect.Dialect dialect)
+ {
+ return "alter table " + Table.GetQualifiedName( dialect ) + dialect.GetDropIndexConstraintString( Name );
+ }
+
+ #endregion
}
}
\ No newline at end of file
|