Roundup Tracker - Issues

Issue 2551113

classification
Consider adding unique=True|False for all hyperdb classes
Type: rfe Severity: normal
Components: Database, Test Versions:
process
Status: new
:
: : rouilj
Priority: normal : GSOC

Created on 2021-03-01 16:14 by rouilj, last changed 2024-02-20 00:00 by rouilj.

Messages
msg7083 Author: [hidden] (rouilj) Date: 2021-03-01 16:14
In https://sourceforge.net/p/roundup/mailman/message/37225443/ Nagy 
Gabor asked:

   Is it possible to tell Roundup to enforce the uniqueness of more
   than one property of a class?

Implement this adding a "unique=BOOLEAN" argument to __init__ of
the _Type class in roundup/hyperdb.py.

In rdbms backends it should add a unique constraint to the column.
In non-rdbms (anydb or other) it will need to execute code to
force constraint to be unique.

Does this make sense for all types?

  String (original use case) - yes, "foreign key" to another
     database somewhere, unique alternate name...

  Date - maybe, how useful is a unique date? Checking that a
     date+interval doesn't overlap any other date+interval is
     more useful (e.g. 1 patient for the 2021-10-14 09:00-09:15
     timeperiod). Could be useful is only a date (no time) is used.

  Link(_Pointer) - maybe, enforce unique relation (e.g. a chassis
     uses only one inventory number, a second chassis can't
     claim the same part). Allow only one issue in a particular
     state. E.G. Only one issue/workorder can be in the paint shop
     "state" at a time. 

  MultiLink(_Pointer)- maybe, don't have a use case.

  Number - yes, unique order if you want to include real values.

  Integer - yes, require unique order value for items

  Password - no, even the same password will have different salts
     so every duplicate password will hash as a different value.

  Interval - no, I think this is useful only with a start date
     (see discussion on Date above).

  Boolean - no, only two values so how useful is this

  Computed (experimental property not in trunk a this time) - no,
     points to a function

Currently this can be implemented using an auditor. See the mailing
list discussion for details.
msg7945 Author: [hidden] (rouilj) Date: 2024-02-20 00:00
See msg 7944 in issue 2551245. Make adding an index have an unique option??
History
Date User Action Args
2024-02-20 00:00:21rouiljsetmessages: + msg7945
2021-03-01 16:14:46rouiljcreate