• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: unique constraint
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unique constraint


  • Subject: Re: unique constraint
  • From: Paul Hoadley <email@hidden>
  • Date: Sat, 31 Mar 2012 11:07:02 +1030

Hi Ted,

On 31/03/2012, at 5:48 AM, Theodore Petrosky wrote:

> Is there a way to put a unique constraint on an attribute in Entity Modeler and have it create the migrations. I don't see anything in any of the menus.

1.  Right-click entity, select "New Entity Index".

2.  Give the index a name, select "Distinct" for Constraint, select the attribute in the drop-down at the bottom and click "Add".

3.  Generate migration.

Whether this works might be database-plugin-dependent, but I can vouch for PostgreSQL.  It should generate something like this:

personTable.addIndex(new ERXMigrationIndex("person_username_key", true, new ColumnIndex("username")));


--
Paul.

http://logicsquad.net/



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: unique constraint
      • From: Theodore Petrosky <email@hidden>
References: 
 >unique constraint (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: Anybody using a decompiler (JD-Eclipse) successfully with Eclipse/WOLips/Lion?
  • Next by Date: Re: Anybody using a decompiler (JD-Eclipse) successfully with Eclipse/WOLips/Lion?
  • Previous by thread: unique constraint
  • Next by thread: Re: unique constraint
  • Index(es):
    • Date
    • Thread