[Bug 19963] New: ethnicity and ethnicity tables and columns survived update
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19963 Bug ID: 19963 Summary: ethnicity and ethnicity tables and columns survived update Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org The database update for 3.21.00.033 should have removed the ethnicity table and the ethnicity and ethnotes columns from borrowers, deletedborrowers and borrower_modifications. This didn't work right in all cases. I just noticed that all those survived in our older databases. The reason is that the database update only checked for NULL when counting existing data, but not for "": 11054 $DBversion = "3.21.00.033"; 11055 if ( CheckVersion($DBversion) ) { 11056 11057 my $done = 0; 11058 my $count_ethnicity = $dbh->selectrow_arrayref(q| 11059 SELECT COUNT(*) FROM ethnicity 11060 |); 11061 my $count_borrower_modifications = $dbh->selectrow_arrayref(q| 11062 SELECT COUNT(*) 11063 FROM borrower_modifications 11064 WHERE ethnicity IS NOT NULL 11065 OR ethnotes IS NOT NULL 11066 |); 11067 my $count_borrowers = $dbh->selectrow_arrayref(q| 11068 SELECT COUNT(*) 11069 FROM borrowers 11070 WHERE ethnicity IS NOT NULL 11071 OR ethnotes IS NOT NULL 11072 |); 11073 # We don't care about the ethnicity of the deleted borrowers, right? 11074 if ( $count_ethnicity->[0] == 0 11075 and $count_borrower_modifications->[0] == 0 11076 and $count_borrowers->[0] == 0 11077 ) { 11078 $dbh->do(q| 11079 DROP TABLE ethnicity 11080 |); 11081 $dbh->do(q| 11082 ALTER TABLE borrower_modifications 11083 DROP COLUMN ethnicity, 11084 DROP COLUMN ethnotes 11085 |); 11086 $dbh->do(q| 11087 ALTER TABLE borrowers 11088 DROP COLUMN ethnicity, 11089 DROP COLUMN ethnotes 11090 |); 11091 $dbh->do(q| 11092 ALTER TABLE deletedborrowers 11093 DROP COLUMN ethnicity, 11094 DROP COLUMN ethnotes 11095 |); 11096 $done = 1; 11097 } 11098 if ( $done ) { 11099 print "Upgrade to $DBversion done (Bug 10020: Drop table ethnicity and columns ethnicity and ethnotes)\n"; 11100 } 11101 else { 11102 print "Upgrade to $DBversion done (Bug 10020: This database contains data related to 'ethnicity'. No change will be done on the DB structure but note that the Koha codebase does not use it)\n"; 11103 } 11104 11105 SetVersion ($DBversion); -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19963 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I guess this change could fix it, but do not have more time to spend on that. There is the warning that is displayed anyway. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19963 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 70806 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70806&action=edit Bug 19963: Update 3.21.00.033 to drop ethnicity data if '' -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19963 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from David Cook <dcook@prosentient.com.au> --- I'm guessing this is still valid? Doesn't appear in new databases but guessing it still affects old ones? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19963 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Yes it would, we probably missed Jobou's patch because the status wasn't changed? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org