Frameworks / DB constraints
Hi fellows, I noticed (in a production server) that a cataloguing framework was deleted by a user. This raised a problem with records that used that framework: trying to look at the record's detail page ended up in a fatal error. Currently, the framework code is not a FK, so we don't enforce it at DB level. A possible solution is to just add it as a FK, another option would be to fallback to the default framework in the relevant function. Jesse proposed on IRC creating the foreign key with ON DELETE SET NULL. We need to fix this, so: ideas? preferences? vote? -- Tomás Cohen Arazi Theke Solutions (http://theke.io) ✆ +54 9351 3513384 GPG: B2F3C15F
Hi to all, Il 19/04/2016 16:34, Tomas Cohen Arazi ha scritto:
Hi fellows, I noticed (in a production server) that a cataloguing framework was deleted by a user. This raised a problem with records that used that framework: trying to look at the record's detail page ended up in a fatal error. [...] Jesse proposed on IRC creating the foreign key with ON DELETE SET NULL.
I'm agree on solution proposed by Jesse: creating the foreign key with ON DELETE SET NULL. Bye Zeno Tajoli -- Zeno Tajoli / SVILUPPO PRODOTTI/ - Automazione Biblioteche Email: z.tajoli@cineca.it Fax: 051/6132198 *CINECA* Consorzio Interuniversitario - Sede operativa di Segrate (MI)
Hi, On Tue, Apr 19, 2016 at 11:16 AM, Tajoli Zeno <z.tajoli@cineca.it> wrote:
I'm agree on solution proposed by Jesse: creating the foreign key with ON DELETE SET NULL.
At the moment, biblio.frameworkcode doesn't permit NULL values, and InnoDB doesn't support ON DELETE SET DEFAULT. That doesn't mean that we couldn't do more work so that frameworkcode IS NULL is fully supported, but it's not *just* a matter of adding the FK. I'm more in favor of either: - adding a FK that does ON DELETE RESTRICT. For most databases, this would require adding a row to biblio_framework whose frameworkcode is the empty string. - having the business logic take care of falling back to the default framework when necessary. Regards, Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / Open Your Library email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
-----Original Message----- From: koha-devel-bounces@lists.koha-community.org [mailto:koha-devel- bounces@lists.koha-community.org] On Behalf Of Galen Charlton Sent: Wednesday, 20 April 2016 12:03 PM To: Tajoli Zeno <z.tajoli@cineca.it> Cc: koha-devel <koha-devel@lists.koha-community.org> Subject: Re: [Koha-devel] Frameworks / DB constraints
Hi,
On Tue, Apr 19, 2016 at 11:16 AM, Tajoli Zeno <z.tajoli@cineca.it> wrote:
I'm agree on solution proposed by Jesse: creating the foreign key with ON DELETE SET NULL.
At the moment, biblio.frameworkcode doesn't permit NULL values, and InnoDB doesn't support ON DELETE SET DEFAULT. That doesn't mean that we couldn't do more work so that frameworkcode IS NULL is fully supported, but it's not *just* a matter of adding the FK.
I'm more in favor of either:
- adding a FK that does ON DELETE RESTRICT. For most databases, this would require adding a row to biblio_framework whose frameworkcode is the empty string. - having the business logic take care of falling back to the default
I agree with Galen. David Cook Systems Librarian Prosentient Systems 72/330 Wattle St Ultimo, NSW 2007 Office: 02 9212 0899 Direct: 02 8005 0595 framework
when necessary.
Regards,
Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / Open Your Library email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha- community.org/ bugs : http://bugs.koha-community.org/
Just a note: From 16.05 it won't be possible to delete a framework in used from the interface. See bug 15790. 2016-04-19 15:34 GMT+01:00 Tomas Cohen Arazi <tomascohen@gmail.com>:
Hi fellows, I noticed (in a production server) that a cataloguing framework was deleted by a user. This raised a problem with records that used that framework: trying to look at the record's detail page ended up in a fatal error.
Currently, the framework code is not a FK, so we don't enforce it at DB level. A possible solution is to just add it as a FK, another option would be to fallback to the default framework in the relevant function. Jesse proposed on IRC creating the foreign key with ON DELETE SET NULL.
We need to fix this, so: ideas? preferences? vote?
-- Tomás Cohen Arazi Theke Solutions (http://theke.io) ✆ +54 9351 3513384 GPG: B2F3C15F
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
So it's fixed. Thanks Jonathan, again :-D 2016-04-23 3:08 GMT-03:00 Jonathan Druart < jonathan.druart@bugs.koha-community.org>:
Just a note: From 16.05 it won't be possible to delete a framework in used from the interface. See bug 15790.
Hi fellows, I noticed (in a production server) that a cataloguing
2016-04-19 15:34 GMT+01:00 Tomas Cohen Arazi <tomascohen@gmail.com>: framework
was deleted by a user. This raised a problem with records that used that framework: trying to look at the record's detail page ended up in a fatal error.
Currently, the framework code is not a FK, so we don't enforce it at DB level. A possible solution is to just add it as a FK, another option would be to fallback to the default framework in the relevant function. Jesse proposed on IRC creating the foreign key with ON DELETE SET NULL.
We need to fix this, so: ideas? preferences? vote?
-- Tomás Cohen Arazi Theke Solutions (http://theke.io) ✆ +54 9351 3513384 GPG: B2F3C15F
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Tomás Cohen Arazi Theke Solutions (http://theke.io) ✆ +54 9351 3513384 GPG: B2F3C15F
Not completely, the constraint could be added anyway. 2016-04-27 15:50 GMT+01:00 Tomas Cohen Arazi <tomascohen@gmail.com>:
So it's fixed. Thanks Jonathan, again :-D
2016-04-23 3:08 GMT-03:00 Jonathan Druart <jonathan.druart@bugs.koha-community.org>:
Just a note: From 16.05 it won't be possible to delete a framework in used from the interface. See bug 15790.
2016-04-19 15:34 GMT+01:00 Tomas Cohen Arazi <tomascohen@gmail.com>:
Hi fellows, I noticed (in a production server) that a cataloguing framework was deleted by a user. This raised a problem with records that used that framework: trying to look at the record's detail page ended up in a fatal error.
Currently, the framework code is not a FK, so we don't enforce it at DB level. A possible solution is to just add it as a FK, another option would be to fallback to the default framework in the relevant function. Jesse proposed on IRC creating the foreign key with ON DELETE SET NULL.
We need to fix this, so: ideas? preferences? vote?
-- Tomás Cohen Arazi Theke Solutions (http://theke.io) ✆ +54 9351 3513384 GPG: B2F3C15F
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Tomás Cohen Arazi Theke Solutions (http://theke.io) ✆ +54 9351 3513384 GPG: B2F3C15F
participants (5)
-
David Cook -
Galen Charlton -
Jonathan Druart -
Tajoli Zeno -
Tomas Cohen Arazi