ispyb / ispyb-database-modeling

4 stars 3 forks source link

BLSession: Unique constraint on (proposalId, visit_number) #41

Open KarlLevik opened 5 years ago

KarlLevik commented 5 years ago

We'd like to add the following UNIQUE constraint on the BLSession table:

ALTER TABLE BLSession
  ADD CONSTRAINT UNIQUE INDEX (proposalId, visit_number);

This way we can ensure we don't get any duplicated visits a.k.a. sessions.