Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Composite Unique Constraint

bhija
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 28, 2025

Hi,

I have a problem with an AO created by my plugin.

I need to add a constraint to my AO so we cannot have a multiple lines with same values in these columns (ID_OBJECT, USER, TYPE).

 

Thank you.

Ayoub

1 answer

0 votes
Aron Gombas _Midori_
Community Champion
May 29, 2025

I don't think it is possible to guarantee that uniqueness using AO annotations. At least it wasn't possible 5 years ago, and I haven't seen much improvement on the AO framework recently.

We had a similar use case, and we solved it by adding our own logic to test uniqueness. (It basically "try to select the record to test this key triplet exists, and only write it if it isn't" and dealing with concurrent writes.)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events