Change default name of primary key

2 posts, 0 answers
  1. dhait
    dhait avatar
    1 posts
    Member since:
    Apr 2007

    Posted 26 Jun 2013 Link to this post

    Using the fluent code-first interface, is there a way to specify the name of primary key created for the table?

    CONSTRAINT [pk_MyTable] PRIMARY KEY ([Field1], [Field2])

    I want to call it something else besides pk_MyTable.
  2. Yordan
    Yordan avatar
    39 posts

    Posted 28 Jun 2013 Link to this post

    Hi David,

    Unfortunately at the moment it is not possible to set a custom name for the primary key constraint. The names of the primary keys are auto-generated and cannot be changed. I hope this is not a showstopper in your scenario.
    If there is something else that we can help you with, please get back to us.
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
  3. DevCraft banner
Back to Top