hello everybody!

I created a table of contacts that requires the first name+last name
to be unique
the table:

db.define_table("Contacts",
      Field("FirstName", "string", length=45, notnull=True),
      Field("LastName", "string", length=45, notnull=True),
      Field("Title", "string", length=45, default=None),
      Field("Department", "string", length=45, default=None),
      Field("Address", "string", length=255, default=None),
      Field("Phone", "string", length=45, default=None),
      Field("Fax", "string", length=45, default=None),
      Field("Email", "string", length=45, default=None),
      Field("Comments", "text", default=None), migrate=True)

how do I instruct the DAL to create unique constraint on FirstName
+LastName when in creates the table in the database?
I have lots of tables that have unique constrain on 2-3 fields, so I
prefer not to do this manually.....
any help will be appreciated!

Reply via email to