[Koha-bugs] [Bug 20271] Merge deleted biblio, biblioitems, biblio_metadata, and items tables
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Jan 28 11:55:13 CET 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20271
Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |In Discussion
--- Comment #198 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
As we are going to face this situation for some other tables as well (at least
columns borrowers.cardnumber, borrowers.userid, issues.itemnumber), I think we
need an approach that will work and be named identically for them.
We could have a boolean flag is_deleted, in addition of deleted_on that
contains an important info. The problem is that it will not work either, as:
The following situation should be valid but will fail the unique constraint:
(id, is_deleted)
(42, 1)
(42, 0)
(42, 0)
So we could have a nullable is_not_deleted:
(id, is_not_deleted)
(42, 1)
(42, NULL)
(42, NULL)
The work but it will not be a boolean, as 0 will not be a "valid" value (not a
big deal anyway).
"is_not_deleted" is not ideal, maybe is_alive? is_current? naming suggestions?
We will not be able to confirm the data integrity between this new column and
deleted_on. But that seems easy to handle at code level.
Note that Postgres can deal with a WHERE clause on a unique constraint. Also
that CHECK could be helpful here, but we need it to be present in the stable
versions of the DBMS we support.
Something else to suggest?
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list