Names for FKs are supported, and have been for quite a while, but PKs are still unsupported AFAIK.
On Tue, Dec 15, 2009 at 3:44 PM, Jeffrey Palermo <[email protected]> wrote: > Any word on this for primary and foreign key constraints? > > We could tackle this with a custom script that runs after SchemaExport. > The script would go through and rename all foreign and primary key > constraints based on the tables in play. That would be a good to have right > out of the box for schema export. > > By the way, if anyone is doing database migrations based on SchemaExport, > the CodeCampServer project has an automation script around RedGate SQL > Compare pro generating change scripts based on a single batch file. > > Best regards, > Jeffrey Palermo > > > On Tue, Feb 17, 2009 at 8:58 AM, James Gregory <[email protected]>wrote: > >> Hey guys, >> >> I've just had a request for Fluent NHibernate to support custom names for >> primary key constraints. I've had a dig around the docs and the schema for >> NH and I'm under the impression this isn't supported, can anyone confirm or >> deny this? >> >> Just to be clear, this isn't custom names for the column but for the >> constraint itself. The schema export tool writes out SQL like this: >> >> create table xxx ( >> id int not null, >> primary key (id) >> ) >> >> You can specify the constraint name by writing it out like so: >> >> create table xxx ( >> id int not null >> ) >> >> alter table xxx add constraint pk_custom_named_constraint primary key (id) >> >> Is this supported? I know foreign key's and check constraints can be >> named, I just can't find anything for the primary key. >> >> Thanks, >> >> James >> >> --~--~---------~--~----~------------~-------~--~----~ >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected]<nhusers%[email protected]> >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en >> -~----------~----~----~----~------~----~------~--~--- >> >> > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
