[Bug 32334] New: Working title
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Bug ID: 32334 Summary: Working title Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org More info follows. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | Summary|Working title |Sync comments in database | |with schema See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26947 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30486 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30486 [Bug 30486] [OMNIBUS] Synchronize database schema with (older) database revisions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 144391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144391&action=edit Bug 32334: Exceptions - Add parameter to WrongParameter Test plan: Run t/Koha/Exceptions.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 144392 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144392&action=edit Bug 32334: Add general exception FileNotFound No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 144393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144393&action=edit Bug 32334: Introduce Koha::Database::Commenter Test plan: [1] Make a backup of your database. Just for precaution. [2] Run t/db_dependent/Koha/Database/Commenter.t. * Note: This test script adds and removes a test table. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 144394 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144394&action=edit Bug 32334: Add sync_db_comments script Test plan: [1] Backup your database, if not done already. [2] Check output of dry_run when clearing a table: misc/maintenance/sync_db_comments.pl -clear -table items -dry [3] Save output of misc/devel/update_dbix_class_files before changing comments in order to compare later. (Commit your changes.) You may not have changes after running (at least on a fresh database). That's fine. [4] Clear all comments: misc/maintenance/sync_db_comments.pl -clear [5] Renumber all comments: misc/maintenance/sync_db_comments.pl -renum [6] Reset all comments to schema. Make sure that script finds your structure in installer/data/mysql folder. misc/maintenance/sync_db_comments.pl -reset [7] Run update_dbix_class_files again and inspect changes as compared to previous run. Can you explain them? You should only see changes related to column comments. If you did not have changes in step 3, you should not have them here too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com, tomascohen@gmail.com --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- A few excerpts from the POD of the new module and script: === SYNOPSIS perl sync_db_comments.pl [-h] [-v] [-database DB_NAME] [-table TABLE_NAME] [-dry_run] [-clear|-reset|-renumber] Synchronize column comments in database with Koha schema. Allows you to clear comments too. Operates additionally on specific tables only. And provides a dry run mode that prints sql statements. This script may prove helpful to track synchronization issues between Koha schema and actual database structure due to inconsistencies in database revisions. It reduces the noise from missing column comments when running script update_dbix_class_files.pl. and The advantage of keeping in sync is that you can easily track differences between schema and database with the maintenance script update_dbix_class_files.pl. === Yes, it adds another module. But keeping track of schema issues is imo important enough. The noise of missing or changed comments can be handled in various ways. This approach was the most practical one for me in the end. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Small patch |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- 1. > The flags -clear, -reset and -renumber are mutually exclusive. Then I think the script should catch this situation. 2. I think we discussed that already, but there is more --confirm flags than --dry-run in our scripts. It's confusing to have both. 3. You should remove references to 'verbose' in the module 4. Path to structure depend on cwd, we can do better. % cd misc/maintenance % perl sync_db_comments.pl --database koha_kohadev --reset Exception 'Koha::Exceptions::FileNotFound' thrown 'File not found' with filename => installer/data/mysql/kohastructure.sql 5. use Data::Dumper (x2) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Do we really need to call clear in reset_to_schema? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Asking for feedback. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #6)
1. > The flags -clear, -reset and -renumber are mutually exclusive.
Then I think the script should catch this situation.
2. I think we discussed that already, but there is more --confirm flags than --dry-run in our scripts. It's confusing to have both.
3. You should remove references to 'verbose' in the module
4. Path to structure depend on cwd, we can do better.
% cd misc/maintenance % perl sync_db_comments.pl --database koha_kohadev --reset Exception 'Koha::Exceptions::FileNotFound' thrown 'File not found' with filename => installer/data/mysql/kohastructure.sql
5. use Data::Dumper (x2)
Thx for your feedback. I definitely like --dry-run but will invert the cmdline flag to --confirm. Removing verbose from the module, although I do not think it is necessary. Other observations addressed too. Will resubmit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #7)
Do we really need to call clear in reset_to_schema?
I think so, yes. A reset to schema implies removing comments that are not in the schema. We could improve later when needed by adding an option or so. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144391|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146712 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146712&action=edit Bug 32334: Exceptions - Add parameter to WrongParameter Test plan: Run t/Koha/Exceptions.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144392|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146713 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146713&action=edit Bug 32334: Add general exception FileNotFound No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144393|0 |1 is obsolete| | --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146714&action=edit Bug 32334: Introduce Koha::Database::Commenter Test plan: [1] Make a backup of your database. Just for precaution. [2] Run t/db_dependent/Koha/Database/Commenter.t. * Note: This test script adds and removes a test table. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144394|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146715 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146715&action=edit Bug 32334: Add sync_db_comments script Test plan: [1] Backup your database, if not done already. [2] Check output of dry_run when clearing a table: misc/maintenance/sync_db_comments.pl -clear -table items -dry [3] Save output of misc/devel/update_dbix_class_files before changing comments in order to compare later. (Commit your changes.) You may not have changes after running (at least on a fresh database). That's fine. [4] Clear all comments: misc/maintenance/sync_db_comments.pl -clear [5] Renumber all comments: misc/maintenance/sync_db_comments.pl -renum [6] Reset all comments to schema. Make sure that script finds your structure in installer/data/mysql folder. misc/maintenance/sync_db_comments.pl -reset [7] Run update_dbix_class_files again and inspect changes as compared to previous run. Can you explain them? You should only see changes related to column comments. If you did not have changes in step 3, you should not have them here too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146716 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146716&action=edit Bug 32334: (QA follow-up) Force mutual exclusiveness of cmdline flags Test plan: Run sync_db_comments.pl --clear --renumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146717 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146717&action=edit Bug 32334: (QA follow-up) Invert dry run mode to commit parameter Note: This is only done (and 'needed') for the command line, not for the module subroutines. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146718&action=edit Bug 32334: (QA follow-up) Remove unused modules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146719 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146719&action=edit Bug 32334: (QA follow-up) Remove fh and verbose parameter in favor of messages The module returns messages. The script can print them in verbose mode. Test script adjusted accordingly. Test plan: Run t/db_dependent/Koha/Database/Commenter.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146720&action=edit Bug 32334: (QA follow-up) Improve finding schema file Adds a schema parameter to the cmdline script now too. Test plan: Run sync_db_comments.pl with -schema file where file does not exist. (On dev install) rename kohastructure.sql, try with[out] referring to it using -schema. You could also use the standard path intranet/cgi-bin/installer/data/mysql. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #20 from David Nind <david@davidnind.com> --- I've had a go at testing, but I am stuck on step 6. Running 'misc/maintenance/sync_db_comments.pl -reset' gives me this output and error message: -- DRY RUN Koha::Database::Commenter::_columns_info(): DBI Exception: DBD::mysql::db selectall_hashref failed: Table 'koha_kohadev.IF' doesn't exist at /kohadevbox/koha/Koha/Database/Commenter.pm line 221 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #20)
I've had a go at testing, but I am stuck on step 6.
Running 'misc/maintenance/sync_db_comments.pl -reset' gives me this output and error message:
-- DRY RUN Koha::Database::Commenter::_columns_info(): DBI Exception: DBD::mysql::db selectall_hashref failed: Table 'koha_kohadev.IF' doesn't exist at /kohadevbox/koha/Koha/Database/Commenter.pm line 221
Ahh. This is a new recent construct in the kohastructure file: CREATE TABLE IF NOT EXISTS `tickets` ( I will add a small regexp change to include IF NOT EXISTS.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Altough it actually is a bit odd: DROP TABLE IF EXISTS `tickets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `tickets` ( First drop table and then check if it not exists.. Ok. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #23 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #22)
Altough it actually is a bit odd:
DROP TABLE IF EXISTS `tickets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE IF NOT EXISTS `tickets` (
First drop table and then check if it not exists.. Ok.
Bug 31028 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #24 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148266&action=edit Bug 32334: (follow-up) Fix for bug 31028, introducing IF NOT EXISTS We need to expect CREATE TABLE IF NOT EXISTS now in kohastructure. Test plan: Run misc/maintenance/sync_db_comments.pl -reset Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31028 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #25 from David Nind <david@davidnind.com> --- Thanks Marcel! I managed to get through the test plan - there were no changes in step 3, so n changes in step 7 (if I did it correctly). I think I tested it correctly, if not I hope QA and those more familiar with what is going on review it. For the (QA follow-up) Improve finding schema file (see comment #19), I'm not sure I did it correctly/what to expect. In KTD the file is in installer/data/mysql rather than intranet/cgi-bin/installer/data/mysql. I: 1. Renamed the file (mv installer/data/mysql/kohastructure.sql installer/data/mysql/renamedkohastructure.sql) 2. Ran the command misc/maintenance/sync_db_comments.pl -schema kohastructure.sql ==> output is: Usage: perl sync_db_comments.pl [-h] [-v] [-schema FILE ] [-database DB_NAME] [-table TABLE_NAME] [-commit] [-clear|-reset|-renumber] 3. If I run with the renamed file, the output is the same. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #26 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #25)
I managed to get through the test plan - there were no changes in step 3, so n changes in step 7 (if I did it correctly).
That should be fine.
I think I tested it correctly, if not I hope QA and those more familiar with what is going on review it.
Great!
For the (QA follow-up) Improve finding schema file (see comment #19), I'm not sure I did it correctly/what to expect. In KTD the file is in installer/data/mysql rather than intranet/cgi-bin/installer/data/mysql. I: 1. Renamed the file (mv installer/data/mysql/kohastructure.sql installer/data/mysql/renamedkohastructure.sql) 2. Ran the command misc/maintenance/sync_db_comments.pl -schema kohastructure.sql ==> output is: Usage: perl sync_db_comments.pl [-h] [-v] [-schema FILE ] [-database DB_NAME] [-table TABLE_NAME] [-commit] [-clear|-reset|-renumber] 3. If I run with the renamed file, the output is the same.
Yeah, the schema parameter was not yet in the cmdline script. And that was a bit confusing. So I added a follow-up for it here after all. If you specify a wrong file now, it warns you: $misc/maintenance/sync_db_comments.pl -schema notexist File notexist not found! Usage: perl sync_db_comments.pl [-h] [-v] [-database DB_NAME] [-table TABLE_NAME] [-schema SCHEMA_FILE] [-commit] [-clear|-reset|-renumber] And when I add the reset option, you will see: $misc/maintenance/sync_db_comments.pl -schema notexist -reset File notexist not found! -- DRY RUN Exception 'Koha::Exceptions::FileNotFound' thrown 'File not found' with filename => notexist When I run with an existing file without reset|clear|renumber, you will not see the warn, only the usage. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #27 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148299&action=edit Bug 32334: (follow-up) Add the -schema parameter to script too Finally adding it here too. Test plan: Copy your kohastructure to xx.sql. Run sync_db_comments.pl -schema xx.sql. You will see usage. Run sync_db_comments.pl -schema xyz.sql. You will see a warn and the usage statement. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148335&action=edit Bug 32334: (follow-up) Improvement for schema parameter Essentially only adds a warn, some cosmetic changes too. Test plan: Copy your kohastructure to xx.sql. Run sync_db_comments.pl -schema xx.sql. You will see usage. Run sync_db_comments.pl -schema xyz.sql. You will see a warn and the usage statement. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #26)
Yeah, the schema parameter was not yet in the cmdline script. And that was a bit confusing. So I added a follow-up for it here after all.
Not in my local branch, but on Bugzilla it was already. Adding to the confusion. Revised the last follow-up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148299|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #30 from David Nind <david@davidnind.com> --- Thanks Marcel for clarifying and updating, retested and sign off on the way. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146712|0 |1 is obsolete| | --- Comment #31 from David Nind <david@davidnind.com> --- Created attachment 148338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148338&action=edit Bug 32334: Exceptions - Add parameter to WrongParameter Test plan: Run t/Koha/Exceptions.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146713|0 |1 is obsolete| | --- Comment #32 from David Nind <david@davidnind.com> --- Created attachment 148339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148339&action=edit Bug 32334: Add general exception FileNotFound No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146714|0 |1 is obsolete| | --- Comment #33 from David Nind <david@davidnind.com> --- Created attachment 148340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148340&action=edit Bug 32334: Introduce Koha::Database::Commenter Test plan: [1] Make a backup of your database. Just for precaution. [2] Run t/db_dependent/Koha/Database/Commenter.t. * Note: This test script adds and removes a test table. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146715|0 |1 is obsolete| | --- Comment #34 from David Nind <david@davidnind.com> --- Created attachment 148341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148341&action=edit Bug 32334: Add sync_db_comments script Test plan: [1] Backup your database, if not done already. [2] Check output of dry_run when clearing a table: misc/maintenance/sync_db_comments.pl -clear -table items -dry [3] Save output of misc/devel/update_dbix_class_files before changing comments in order to compare later. (Commit your changes.) You may not have changes after running (at least on a fresh database). That's fine. [4] Clear all comments: misc/maintenance/sync_db_comments.pl -clear [5] Renumber all comments: misc/maintenance/sync_db_comments.pl -renum [6] Reset all comments to schema. Make sure that script finds your structure in installer/data/mysql folder. misc/maintenance/sync_db_comments.pl -reset [7] Run update_dbix_class_files again and inspect changes as compared to previous run. Can you explain them? You should only see changes related to column comments. If you did not have changes in step 3, you should not have them here too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146716|0 |1 is obsolete| | --- Comment #35 from David Nind <david@davidnind.com> --- Created attachment 148342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148342&action=edit Bug 32334: (QA follow-up) Force mutual exclusiveness of cmdline flags Test plan: Run sync_db_comments.pl --clear --renumber Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146717|0 |1 is obsolete| | --- Comment #36 from David Nind <david@davidnind.com> --- Created attachment 148343 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148343&action=edit Bug 32334: (QA follow-up) Invert dry run mode to commit parameter Note: This is only done (and 'needed') for the command line, not for the module subroutines. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146718|0 |1 is obsolete| | --- Comment #37 from David Nind <david@davidnind.com> --- Created attachment 148344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148344&action=edit Bug 32334: (QA follow-up) Remove unused modules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146719|0 |1 is obsolete| | --- Comment #38 from David Nind <david@davidnind.com> --- Created attachment 148345 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148345&action=edit Bug 32334: (QA follow-up) Remove fh and verbose parameter in favor of messages The module returns messages. The script can print them in verbose mode. Test script adjusted accordingly. Test plan: Run t/db_dependent/Koha/Database/Commenter.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146720|0 |1 is obsolete| | --- Comment #39 from David Nind <david@davidnind.com> --- Created attachment 148346 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148346&action=edit Bug 32334: (QA follow-up) Improve finding schema file Adds a schema parameter to the cmdline script now too. Test plan: Run sync_db_comments.pl with -schema file where file does not exist. (On dev install) rename kohastructure.sql, try with[out] referring to it using -schema. You could also use the standard path intranet/cgi-bin/installer/data/mysql. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148266|0 |1 is obsolete| | --- Comment #40 from David Nind <david@davidnind.com> --- Created attachment 148347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148347&action=edit Bug 32334: (follow-up) Fix for bug 31028, introducing IF NOT EXISTS We need to expect CREATE TABLE IF NOT EXISTS now in kohastructure. Test plan: Run misc/maintenance/sync_db_comments.pl -reset Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148335|0 |1 is obsolete| | --- Comment #41 from David Nind <david@davidnind.com> --- Created attachment 148348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148348&action=edit Bug 32334: (follow-up) Improvement for schema parameter Essentially only adds a warn, some cosmetic changes too. Test plan: Copy your kohastructure to xx.sql. Run sync_db_comments.pl -schema xx.sql. You will see usage. Run sync_db_comments.pl -schema xyz.sql. You will see a warn and the usage statement. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #42 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #30)
Thanks Marcel for clarifying and updating, retested and sign off on the way.
Great! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148338|0 |1 is obsolete| | Attachment #148339|0 |1 is obsolete| | Attachment #148340|0 |1 is obsolete| | Attachment #148341|0 |1 is obsolete| | Attachment #148342|0 |1 is obsolete| | Attachment #148343|0 |1 is obsolete| | Attachment #148344|0 |1 is obsolete| | Attachment #148345|0 |1 is obsolete| | Attachment #148346|0 |1 is obsolete| | Attachment #148347|0 |1 is obsolete| | Attachment #148348|0 |1 is obsolete| | --- Comment #43 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149259&action=edit Bug 32334: Exceptions - Add parameter to WrongParameter Test plan: Run t/Koha/Exceptions.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #44 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149260&action=edit Bug 32334: Add general exception FileNotFound No test plan. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #45 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149261 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149261&action=edit Bug 32334: Introduce Koha::Database::Commenter Test plan: [1] Make a backup of your database. Just for precaution. [2] Run t/db_dependent/Koha/Database/Commenter.t. * Note: This test script adds and removes a test table. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #46 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149262 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149262&action=edit Bug 32334: Add sync_db_comments script Test plan: [1] Backup your database, if not done already. [2] Check output of dry_run when clearing a table: misc/maintenance/sync_db_comments.pl -clear -table items -dry [3] Save output of misc/devel/update_dbix_class_files before changing comments in order to compare later. (Commit your changes.) You may not have changes after running (at least on a fresh database). That's fine. [4] Clear all comments: misc/maintenance/sync_db_comments.pl -clear [5] Renumber all comments: misc/maintenance/sync_db_comments.pl -renum [6] Reset all comments to schema. Make sure that script finds your structure in installer/data/mysql folder. misc/maintenance/sync_db_comments.pl -reset [7] Run update_dbix_class_files again and inspect changes as compared to previous run. Can you explain them? You should only see changes related to column comments. If you did not have changes in step 3, you should not have them here too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #47 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149263 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149263&action=edit Bug 32334: (QA follow-up) Force mutual exclusiveness of cmdline flags Test plan: Run sync_db_comments.pl --clear --renumber Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #48 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149264 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149264&action=edit Bug 32334: (QA follow-up) Invert dry run mode to commit parameter Note: This is only done (and 'needed') for the command line, not for the module subroutines. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #49 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149265 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149265&action=edit Bug 32334: (QA follow-up) Remove unused modules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #50 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149266&action=edit Bug 32334: (QA follow-up) Remove fh and verbose parameter in favor of messages The module returns messages. The script can print them in verbose mode. Test script adjusted accordingly. Test plan: Run t/db_dependent/Koha/Database/Commenter.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #51 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149267&action=edit Bug 32334: (QA follow-up) Improve finding schema file Adds a schema parameter to the cmdline script now too. Test plan: Run sync_db_comments.pl with -schema file where file does not exist. (On dev install) rename kohastructure.sql, try with[out] referring to it using -schema. You could also use the standard path intranet/cgi-bin/installer/data/mysql. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #52 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149268 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149268&action=edit Bug 32334: (follow-up) Fix for bug 31028, introducing IF NOT EXISTS We need to expect CREATE TABLE IF NOT EXISTS now in kohastructure. Test plan: Run misc/maintenance/sync_db_comments.pl -reset Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #53 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149269 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149269&action=edit Bug 32334: (follow-up) Improvement for schema parameter Essentially only adds a warn, some cosmetic changes too. Test plan: Copy your kohastructure to xx.sql. Run sync_db_comments.pl -schema xx.sql. You will see usage. Run sync_db_comments.pl -schema xyz.sql. You will see a warn and the usage statement. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #54 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149270 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149270&action=edit Bug 32334: Fix spelling Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #55 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 --- Comment #56 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #55)
Pushed to master for 23.05.
Nice work everyone, thanks!
Thanks Jonathan and Tomas. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Needs documenting CC| |jacob.omara@ptfs-europe.com --- Comment #57 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Enhancement - not backporting to 22.11.x Nice work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33584 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33584 [Bug 33584] Fix failures for Database/Commenter.t on MySQL 8 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED CC| |caroline.cyr-la-rose@inlibr | |o.com Resolution|--- |FIXED --- Comment #58 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Back end stuff, doesn't affect the end user so there's nothing to add/amend in the manual. I believe the schema (https://schema.koha-community.org/) is updated automatically, so there's no need to put DB bugs as Needs documenting. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32334 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34843 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34843 [Bug 34843] Koha/Database/Commenter.t is failing if the DB has been upgraded -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org