diff --git a/toardb/contacts/models_person.py b/toardb/contacts/models_person.py index 54ce047ee190fe3dc8526e47d354860af961a0bb..b46fc3aafe3db128e19ececb8ba5d8c321cf6c9a 100644 --- a/toardb/contacts/models_person.py +++ b/toardb/contacts/models_person.py @@ -25,11 +25,16 @@ class Person(Base): +-----------+------------------------+-----------+----------+-------------------------------------+ Indexes: "persons_pkey" PRIMARY KEY, btree (id) + "persons_name_email" UNIQUE CONSTRAINT, btree (name, email) Referenced by: TABLE "station_roles" CONSTRAINT "station_roles_person_id_3bd9c160_fk_persons_id" FOREIGN KEY (person_id) REFERENCES persons(id) DEFERRABLE INITIALLY DEFERRED TABLE "timeseries_roles" CONSTRAINT "timeseries_roles_person_id_3e26200e_fk_persons_id" FOREIGN KEY (person_id) REFERENCES persons(id) DEFERRABLE INITIALLY DEFERRED """ __tablename__ = 'persons' + __table_args__ = ( + UniqueConstraint('name', 'email'), + ) + id = Column(Integer, PERSONS_ID_SEQ, primary_key=True, server_default=PERSONS_ID_SEQ.next_value()) name = Column(String(64), nullable=False)