Avoiding double entries regarding combination of two columns

Hello everyone,

I had issues with double entries. Hence I’m looking forward to make two columns (1:1 relations from another table) in combination unique. According to this thread, backendless doesn’t support that, is that still the case? However I found out, that a workaround may be possible with a generated unique column made of the two other columns. That works perfectly with columns from the same table, but I would need it from other tables. Is that possible or is there another workaround?

Thanks!

Hello @Laci and welcome to our community!

According to this thread , backendless doesn’t support that, is that still the case?

Unfortunately yes, this is not supported in the way to use constraints.
If we talking about the uniqueness of two columns in the same table, then creating a generated column is an appropriate way. And if you would like to maintain the uniqueness of columns from different tables, then DB can’t handle such use-case and I would suggest you use our custom business logic in order to handle this manually before saving data to DB.

Regards,
Stanislaw

Hi @Laci ,

Do you have an idea how to handle it with Business Logic (aka Cloud Code)?

Mark

Hello,

@stanislaw.grin thanks for clarifying!

@mark-piller not yet, up until now I have just briefly worked with Business Logic

Please give it a try and let us know if you get stuck

1 Like