diff --git a/toardb/contacts/models.py b/toardb/contacts/models.py
index 0c33a6edbc3b2b17089d686a3b97b2fabeb5a9a7..3846012f8d85f4351daadb49e598b74c946f0ce8 100644
--- a/toardb/contacts/models.py
+++ b/toardb/contacts/models.py
@@ -10,7 +10,7 @@ from .models_person import Person
 from .models_organisation import Organisation
 
 from sqlalchemy import Table, Column, Integer, String, \
-                       ForeignKey, text, CheckConstraint, Sequence
+                       ForeignKey, text, CheckConstraint, UniqueConstraint, Sequence
 from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy.orm import relationship
 
@@ -51,16 +51,21 @@ class Contact(Base):
     +-----------------+---------+-----------+----------+----------------------------------------+
     Indexes:
         "contacts_pkey" PRIMARY KEY, btree (id)
+        "contacts_person_id_organisation_id" UNIQUE CONSTRAINT, btree (person_id, organisation_id)
     Check constraints:
         "ck_contact" CHECK (person_id > 0 AND organisation_id = 0 OR person_id = 0 AND organisation_id > 0)
     Foreign-key constraints:
         "contacts_organisation_id_fkey" FOREIGN KEY (organisation_id) REFERENCES organisations(id)
         "contacts_person_id_fkey" FOREIGN KEY (person_id) REFERENCES persons(id)
+    Referenced by:
+        TABLE "stationmeta_roles" CONSTRAINT "stationmeta_roles_contact_id_fk_contacts_id" FOREIGN KEY (contact_id) REFERENCES contacts(id) DEFERRABLE INITIALLY DEFERRED
+        TABLE "timeseries_roles" CONSTRAINT "timeseries_roles_contact_id_fk_contacts_id" FOREIGN KEY (contact_id) REFERENCES contacts(id) DEFERRABLE INITIALLY DEFERRED
     """
 
     __tablename__ = 'contacts'
     __table_args__ = (
         CheckConstraint('((person_id > 0) AND (organisation_id = 0)) OR ((person_id = 0) AND (organisation_id > 0))'),
+        UniqueConstraint('person_id', 'organisation_id')
     )
 
     id = Column(Integer, primary_key=True, server_default=text("nextval('contacts_id_seq'::regclass)"))
diff --git a/toardb/contacts/models_organisation.py b/toardb/contacts/models_organisation.py
index 31d4dc436a7a824ae5fd0a4149ca6c958e024fdf..d2427cfaa78dced9974d79d3426d92fa80c04794 100644
--- a/toardb/contacts/models_organisation.py
+++ b/toardb/contacts/models_organisation.py
@@ -17,7 +17,7 @@ class Organisation(Base):
     +----------------+------------------------+-----------+----------+-------------------------------------------+
     | name           | character varying(32)  |           | not null |                                           |
     +----------------+------------------------+-----------+----------+-------------------------------------------+
-    | longname       | character varying(128) |           | not null |                                           |
+    | longname       | character varying(256) |           | not null |                                           |
     +----------------+------------------------+-----------+----------+-------------------------------------------+
     | kind           | integer                |           | not null |                                           |
     +----------------+------------------------+-----------+----------+-------------------------------------------+
@@ -45,7 +45,7 @@ class Organisation(Base):
 
     id = Column(Integer, ORGANISATIONS_ID_SEQ, primary_key=True, server_default=ORGANISATIONS_ID_SEQ.next_value())
     name = Column(String(32), nullable=False)
-    longname = Column(String(128), nullable=False)
+    longname = Column(String(256), nullable=False)
     kind = Column(ForeignKey('ok_vocabulary.enum_val'), nullable=False)
     city = Column(String(64), nullable=False)
     postcode = Column(String(16), nullable=False)
diff --git a/toardb/timeseries/models_role.py b/toardb/timeseries/models_role.py
index 2db40ead0dccf03db67ee3f34bbfa79c8260b916..6d3d53a702c6a98977ac65650db3cc1c684fd4c3 100644
--- a/toardb/timeseries/models_role.py
+++ b/toardb/timeseries/models_role.py
@@ -34,7 +34,7 @@ class TimeseriesRole(Base):
     +---------------+---------+-----------+----------+----------------------------------------------+
     Indexes:
         "timeseries_roles_pkey" PRIMARY KEY, btree (id)
-        "timeseries_roles_role_contact_id_uniq" UNIQUE CONSTRAINT, btree (role, contact_id)
+        "timeseries_roles_role_status_contact_id_uniq" UNIQUE CONSTRAINT, btree (role, status, contact_id)
         "timeseries_roles_contact_id" btree (contact_id)
     Check constraints:
         "timeseries_roles_role_check" CHECK (role >= 0)
@@ -47,7 +47,7 @@ class TimeseriesRole(Base):
     __table_args__ = (
         CheckConstraint('role >= 0'),
         CheckConstraint('status >= 0'),
-        UniqueConstraint('role', 'contact_id')
+        UniqueConstraint('role', 'status', 'contact_id')
     )
 
     id = Column(Integer, TIMESERIES_ROLES_ID_SEQ, primary_key=True, server_default=TIMESERIES_ROLES_ID_SEQ.next_value())