Author Topic: Create unique constraint with multiple columns  (Read 931 times)

Jordi

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Create unique constraint with multiple columns
« on: September 29, 2008, 08:42:36 pm »
Hello everybody,

I'm new here, my name is Jordi and I use EA for enginyering. I hope to help anybody sometime but now I'm who need some help.

I don't now how to create a unike key with multiple columns.

For exemple, I have a table "adress" with columns "id", "street", "number", "floor", "door", etc.. I need to declare a unike key on DBMS with "street", "number", "floor", "door" (no one by one, but all together).

On my DBMS (PostgreSQL) I do ADD CONSTRAINT "hi" UNIQUE ("street", "number", "floor", "door").

Does anybody now how to write this on EA data model (on table)?

Thanks everybody and I hope to see you soon,

Jordi

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Create unique constraint with multiple columns
« Reply #1 on: September 29, 2008, 10:22:16 pm »
No problem Jordi,

Create all the columns you will need in each table, assigning them attributes as appropriate. [In this case they would not be unique.]

In each table create an operation with the stereotype «index» (which will be available from the drop-down). Save the index and then click the Column tab to add columns in the order you require. Save the index again. Click the Extended Properties on the General tab and set the unique and other properties as appropriate.

David
No, you can't have it!

Jordi

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Create unique constraint with multiple columns
« Reply #2 on: September 29, 2008, 11:32:43 pm »
Hello Midnight,

I allready used it.

Thank you very much for your help.

We'll see here around.