Summary: | TableExists should be used instead of IF NOT EXISTS in updatedatabase | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Architecture, internals, and plumbing | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | 1joynelson, jonathan.druart, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7902 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.06
|
|
Circulation function: | |||
Attachments: |
Bug 24994: Correct DB Updates
Bug 24994: Correct DB Updates Bug 24994: Correct DB Updates |
Description
Martin Renvoize (ashimema)
2020-03-26 16:01:10 UTC
Created attachment 101887 [details] [review] Bug 24994: Correct DB Updates I corrected the cases I introduced in this patch.. Tomas, why did you suggest that? I cannot remember why we should not use "DROP IF EXISTS" If we go that way, we need: * a guideline (and explain why) * a check to the QA script See also https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7902#c3 Even if we choose to stick to IF EXISTS it may be nice to add a QA script check for both ADD TABLE (IF NOT EXISTS) and DROP TABE (IF EXISTS).. I know I've missed those on occasions myself.. I don't remember there being a QA check for it as yet (probably because we had the TableExists function as an option). (In reply to Jonathan Druart from comment #3) > Tomas, why did you suggest that? > I cannot remember why we should not use "DROP IF EXISTS" > > If we go that way, we need: > * a guideline (and explain why) > * a check to the QA script > > See also https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7902#c3 I pointed a case of table creation. Maybe my comment was too generic. I have no opinion on the drop case. DROP IF EXISTS could be bad for features we backported that include tables. The data would be lost. Created attachment 104846 [details] [review] Bug 24994: Correct DB Updates Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 104895 [details] [review] Bug 24994: Correct DB Updates Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> backported to 19.11.06 |