[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Pedro Amorim changed: What|Removed |Added Blocks||36039 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36039 [Bug 36039] Output of database_audit.pl should be accessible through UI -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Katrin Fischer changed: What|Removed |Added Resolution|--- |FIXED Status|Pushed to master|RESOLVED -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Fridolin Somers changed: What|Removed |Added CC||fridolin.som...@biblibre.co ||m --- Comment #38 from Fridolin Somers --- Enhancement not pushed to 23.05.x Looks great ! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #37 from Tomás Cohen Arazi --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Tomás Cohen Arazi changed: What|Removed |Added Status|Passed QA |Pushed to master Version(s)||23.11.00 released in|| -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Martin Renvoize changed: What|Removed |Added Status|BLOCKED |Passed QA --- Comment #36 from Martin Renvoize --- I think it should be back to PQA :).. setting as such. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #35 from David Cook --- So I think we've figured out the dependency thing. Should this still be BLOCKED or should it go back to "Passed QA"? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added Attachment #153022|0 |1 is obsolete|| --- Comment #34 from David Cook --- Created attachment 153023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153023=edit Bug 34064: Add SQL::Translator dependency to cpanfile -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #33 from David Cook --- The API looks the same so maybe I will just downgrade it... https://metacpan.org/release/VEESH/SQL-Translator-1.63/view/lib/SQL/Translator/Diff.pm https://metacpan.org/release/ILMARI/SQL-Translator-0.11024/view/lib/SQL/Translator/Diff.pm -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #32 from David Cook --- Worth noting that SQL::Translator 1.62 is available from Debian 11 and Ubuntu 20.04. While we've dropped Ubuntu 18.04 from https://wiki.koha-community.org/wiki/System_requirements_and_recommendations we haven't dropped Debian 10. While Debian 10 has passed it's normal EOL, it appears to have EOL LTS to 2024-06-30. This patch was tested against SQL::Translator 1.62, so that's what I've put into the cpanfile patch. -- We could either lower the cpanfile requirement to 0.11024 (the version in Debian 10 and Ubuntu 18.04) and test, or we could package SQL::Translator 1.62 for Debian 10 Buster. While the version numbers are very different, the changes don't look massive: https://metacpan.org/dist/SQL-Translator/changes -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #31 from David Cook --- Created attachment 153022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153022=edit Bug 34064: Add SQL::Translator dependency to cpanfile -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #30 from Marcel de Rooy --- (In reply to David Cook from comment #28) > At the moment "libtest-dbix-class-perl" is a dependency of koha-common, but > it's one that I'd like to remove one day, so it's worth adding > "libsql-translator-perl" as a Koha dependency. Just do it. Love to hear that :) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #29 from David Cook --- (In reply to Tomás Cohen Arazi from comment #27) > I checked. And `pmvers` would tell me the Diff one was not installed. `pmvers` doesn't work for SQL::Translator::Diff, since that package doesn't have a $VERSION variable. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #28 from David Cook --- (In reply to Tomás Cohen Arazi from comment #27) > (In reply to David Cook from comment #26) > > (In reply to David Cook from comment #25) > > > They're dependencies of DBIx::Class, but probably a good idea to > > > explicitly > > > add them as well. > > > > Or rather they're dependencies of the Debian package. > > I checked. And `pmvers` would tell me the Diff one was not installed. Run "dpkg -L libsql-translator-perl". You'll see them both in the output: /usr/share/perl5/SQL/Translator/Diff.pm /usr/share/perl5/SQL/Translator.pm And I made a mistake about the dependencies. It's not a dependency of libdbix-class-perl. It's a dependency of "libtest-dbix-class-perl". At the moment "libtest-dbix-class-perl" is a dependency of koha-common, but it's one that I'd like to remove one day, so it's worth adding "libsql-translator-perl" as a Koha dependency. But production Koha systems definitely already have both SQL::Translator and SQL::Translator::Diff installed because they have "libtest-dbix-class-perl" installed. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #27 from Tomás Cohen Arazi --- (In reply to David Cook from comment #26) > (In reply to David Cook from comment #25) > > They're dependencies of DBIx::Class, but probably a good idea to explicitly > > add them as well. > > Or rather they're dependencies of the Debian package. I checked. And `pmvers` would tell me the Diff one was not installed. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #26 from David Cook --- (In reply to David Cook from comment #25) > They're dependencies of DBIx::Class, but probably a good idea to explicitly > add them as well. Or rather they're dependencies of the Debian package. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #25 from David Cook --- (In reply to Tomás Cohen Arazi from comment #24) > Mason, are we good to go with the dependencies? > > SQL::Translator > SQL::Translator::Diff > > Marking blocked until then. They're dependencies of DBIx::Class, but probably a good idea to explicitly add them as well. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Tomás Cohen Arazi changed: What|Removed |Added Status|Passed QA |BLOCKED CC||m...@kohaaloha.com, ||tomasco...@gmail.com Keywords||dependency --- Comment #24 from Tomás Cohen Arazi --- Mason, are we good to go with the dependencies? SQL::Translator SQL::Translator::Diff Marking blocked until then. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Martin Renvoize changed: What|Removed |Added Status|Signed Off |Passed QA CC||martin.renvoize@ptfs-europe ||.com QA Contact|testo...@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com --- Comment #23 from Martin Renvoize --- I think this is actually really rather useful to admins.. it's a simple way to do the compare of dumps that Jonathan suggests, but in a nice report. Script works, doesn't cause any harm.. I'm going to PQA :) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Martin Renvoize changed: What|Removed |Added Attachment #152576|0 |1 is obsolete|| --- Comment #22 from Martin Renvoize --- Created attachment 152740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152740=edit Bug 34064: Remove no_batch_alters option This change removes the no_batch_alters option. When working with real world databases, you really want to use batch alters to group together changes. Otherwise, the output becomes too overwhelming/unwieldy. On real world databases, I'm noticing big discrepancies, although I think most of the time this is a difference in the collation at the column level. Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Martin Renvoize changed: What|Removed |Added Attachment #152575|0 |1 is obsolete|| --- Comment #21 from Martin Renvoize --- Created attachment 152739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152739=edit Bug 34064: Add an audit script to compare database with kohastructure.sql This script can take a connected database handle and compare that database schema against kohastructure.sql to see what changes the database would need in order to match kohastructure.sql NOTE: It uses SQL::Translation::Diff, which is installed with DBIx::Class. WARNING: The diff doesn't seem to compare comments, so that difference won't appear in the output. If we wanted, we could easily enhance the audit_database.pl script to also compare comments. WARNING: The output is a proposed series of SQL commands. While they are useful to review, they won't always duplicate the changes done by updatedatabase.pl, so it's important to carefully analyze the output. The key purpose of this audit script is to just highlight the differences between the two. Test plan: 0. Apply patch 1. vi ./installer/data/mysql/kohastructure.sql 2. Comment out some columns, change NULL status, or whatever you like 3. perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql 4. Note that the output includes SQL commands to change the database to match the new kohastructure.sql 5a. Try using koha-foreach and note that the database name appears above the database comparison 5b. koha-foreach "perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql" Signed-off-by: Emmi Takkinen Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #20 from David Cook --- (In reply to Owen Leonard from comment #19) > The database I use for testing is an older one from our production system > and it has been updated again and again. I needed a tool today to figure out > whether my problems importing patrons were Koha's fault or my database's, > and this tool identified a number of problems which I was able to resolve. > Now I can test patron imports again. That's awesome, Owen! You made my day :). -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #19 from Owen Leonard --- A note about my testing: I did not perform the test using koha-foreach, only on my single test database. The database I use for testing is an older one from our production system and it has been updated again and again. I needed a tool today to figure out whether my problems importing patrons were Koha's fault or my database's, and this tool identified a number of problems which I was able to resolve. Now I can test patron imports again. Note: I changed one spelling error identified by the QA tool during signoff: unecessarily -> unnecessarily -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #18 from Owen Leonard --- Created attachment 152576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152576=edit Bug 34064: Remove no_batch_alters option This change removes the no_batch_alters option. When working with real world databases, you really want to use batch alters to group together changes. Otherwise, the output becomes too overwhelming/unwieldy. On real world databases, I'm noticing big discrepancies, although I think most of the time this is a difference in the collation at the column level. Signed-off-by: Owen Leonard -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Owen Leonard changed: What|Removed |Added Attachment #152481|0 |1 is obsolete|| Attachment #152482|0 |1 is obsolete|| --- Comment #17 from Owen Leonard --- Created attachment 152575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152575=edit Bug 34064: Add an audit script to compare database with kohastructure.sql This script can take a connected database handle and compare that database schema against kohastructure.sql to see what changes the database would need in order to match kohastructure.sql NOTE: It uses SQL::Translation::Diff, which is installed with DBIx::Class. WARNING: The diff doesn't seem to compare comments, so that difference won't appear in the output. If we wanted, we could easily enhance the audit_database.pl script to also compare comments. WARNING: The output is a proposed series of SQL commands. While they are useful to review, they won't always duplicate the changes done by updatedatabase.pl, so it's important to carefully analyze the output. The key purpose of this audit script is to just highlight the differences between the two. Test plan: 0. Apply patch 1. vi ./installer/data/mysql/kohastructure.sql 2. Comment out some columns, change NULL status, or whatever you like 3. perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql 4. Note that the output includes SQL commands to change the database to match the new kohastructure.sql 5a. Try using koha-foreach and note that the database name appears above the database comparison 5b. koha-foreach "perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql" Signed-off-by: Emmi Takkinen Signed-off-by: Owen Leonard -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Owen Leonard changed: What|Removed |Added Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added See Also||https://bugs.koha-community ||.org/bugzilla3/show_bug.cgi ||?id=34065 --- Comment #16 from David Cook --- I'm a bit disappointed that people aren't as excited about this script as I am, but that's OK. I wrote it to help me fix my local databases, and it's already showing me lots of differences. I can keep this as a local tool, and use it raise Bugzilla issues. I just thought the community would find it useful, since this is an area that we've really struggled with together for many years. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #15 from David Cook --- (In reply to Marcel de Rooy from comment #10) > (In reply to Jonathan Druart from comment #7) > > Why not using koha-dump? > > With misc/maintenance/sync_db_comments.pl you could then compare with > > kohastructure.sql I think. > > Yes, we are already having code to do this job or similar code that we could > merge instead of adding more? (In reply to Marcel de Rooy from comment #11) > Another example (code that I added :) is Koha/Database/Commenter. > The associated script helps you to get rid of all changed comment cruft and > only focus on the real db changes. I did take a look at Koha::Database::Commenter, but it is specific to comments and it's not fully parsing the SQL. SQL::Translator is a great externally maintained library that makes it easy to programmatically work with database schemas, and it's already a dependency of the DBIx::Class deb package. Koha::Database::Commenter could be replaced with a SQL::Translator based mechanism. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #14 from David Cook --- (In reply to Emmi Takkinen from comment #9) > Oh boy. And here I was thinking that my database has a lot of changes to > consider (maybe around 200 lines). Although, mine isn't as cleaned up as our > production databases. Would be interesting to see how those still differ > from kohastructure.sql. Right? I'm finding the discrepancies very interesting. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #13 from David Cook --- (In reply to Julian Maurice from comment #8) > I think it doesn't work for me. It tells me to change all varchar/text > column. I tried executing one of these queries and ran the script again: > this one query still shows up. It's probably related to collation or character set. I was a bit confused at first by some of the suggestions, and that's what it ended up being. Which query still shows up? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #12 from David Cook --- (In reply to Jonathan Druart from comment #7) > Why not using koha-dump? > With misc/maintenance/sync_db_comments.pl you could then compare with > kohastructure.sql I think. You mean comparing a schema dump and kohastructure.sql? That could work, but it puts a lot of work on the human brain I think. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #11 from Marcel de Rooy --- Another example (code that I added :) is Koha/Database/Commenter. The associated script helps you to get rid of all changed comment cruft and only focus on the real db changes. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #10 from Marcel de Rooy --- (In reply to Jonathan Druart from comment #7) > Why not using koha-dump? > With misc/maintenance/sync_db_comments.pl you could then compare with > kohastructure.sql I think. Yes, we are already having code to do this job or similar code that we could merge instead of adding more? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Marcel de Rooy changed: What|Removed |Added CC||m.de.r...@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #9 from Emmi Takkinen --- (In reply to David Cook from comment #4) > Thanks, Emmi, although I'm going to make a little tweak. > > I've been running this on a backup server, and finding the output too > unwieldy without the tweak. > > It's amazing looking at real world databases though. My first database has > about 1400 lines of suggested changes. > > Lots of the changes are for little things like synchronizing column > collations, but it just goes to show how different updatedatabase.pl is from > kohastructure.sql... Oh boy. And here I was thinking that my database has a lot of changes to consider (maybe around 200 lines). Although, mine isn't as cleaned up as our production databases. Would be interesting to see how those still differ from kohastructure.sql. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Julian Maurice changed: What|Removed |Added CC||julian.maur...@biblibre.com --- Comment #8 from Julian Maurice --- I think it doesn't work for me. It tells me to change all varchar/text column. I tried executing one of these queries and ran the script again: this one query still shows up. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #7 from Jonathan Druart --- Why not using koha-dump? With misc/maintenance/sync_db_comments.pl you could then compare with kohastructure.sql I think. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #6 from David Cook --- On a built server it would be: koha-foreach "perl /usr/share/koha/bin/maintenance/audit_database.pl --filename /usr/share/koha/intranet/cgi-bin/installer/data/mysql/kohastructure.sql" > audit_database.log -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #5 from David Cook --- Created attachment 152482 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152482=edit Bug 34064: Remove no_batch_alters option This change removes the no_batch_alters option. When working with real world databases, you really want to use batch alters to group together changes. Otherwise, the output becomes too overwhelming/unwieldy. On real world databases, I'm noticing big discrepancies, although I think most of the time this is a difference in the collation at the column level. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #4 from David Cook --- Thanks, Emmi, although I'm going to make a little tweak. I've been running this on a backup server, and finding the output too unwieldy without the tweak. It's amazing looking at real world databases though. My first database has about 1400 lines of suggested changes. Lots of the changes are for little things like synchronizing column collations, but it just goes to show how different updatedatabase.pl is from kohastructure.sql... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Emmi Takkinen changed: What|Removed |Added Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 Emmi Takkinen changed: What|Removed |Added Attachment #152480|0 |1 is obsolete|| CC||emmi.takki...@koha-suomi.fi --- Comment #3 from Emmi Takkinen --- Created attachment 152481 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152481=edit Bug 34064: Add an audit script to compare database with kohastructure.sql This script can take a connected database handle and compare that database schema against kohastructure.sql to see what changes the database would need in order to match kohastructure.sql NOTE: It uses SQL::Translation::Diff, which is installed with DBIx::Class. WARNING: The diff doesn't seem to compare comments, so that difference won't appear in the output. If we wanted, we could easily enhance the audit_database.pl script to also compare comments. WARNING: The output is a proposed series of SQL commands. While they are useful to review, they won't always duplicate the changes done by updatedatabase.pl, so it's important to carefully analyze the output. The key purpose of this audit script is to just highlight the differences between the two. Test plan: 0. Apply patch 1. vi ./installer/data/mysql/kohastructure.sql 2. Comment out some columns, change NULL status, or whatever you like 3. perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql 4. Note that the output includes SQL commands to change the database to match the new kohastructure.sql 5a. Try using koha-foreach and note that the database name appears above the database comparison 5b. koha-foreach "perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql" Signed-off-by: Emmi Takkinen -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added See Also||https://bugs.koha-community ||.org/bugzilla3/show_bug.cgi ||?id=34063 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added Attachment #152479|0 |1 is obsolete|| --- Comment #2 from David Cook --- Created attachment 152480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152480=edit Bug 34064: Add an audit script to compare database with kohastructure.sql This script can take a connected database handle and compare that database schema against kohastructure.sql to see what changes the database would need in order to match kohastructure.sql NOTE: It uses SQL::Translation::Diff, which is installed with DBIx::Class. WARNING: The diff doesn't seem to compare comments, so that difference won't appear in the output. If we wanted, we could easily enhance the audit_database.pl script to also compare comments. WARNING: The output is a proposed series of SQL commands. While they are useful to review, they won't always duplicate the changes done by updatedatabase.pl, so it's important to carefully analyze the output. The key purpose of this audit script is to just highlight the differences between the two. Test plan: 0. Apply patch 1. vi ./installer/data/mysql/kohastructure.sql 2. Comment out some columns, change NULL status, or whatever you like 3. perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql 4. Note that the output includes SQL commands to change the database to match the new kohastructure.sql 5a. Try using koha-foreach and note that the database name appears above the database comparison 5b. koha-foreach "perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql" -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added Assignee|koha-b...@lists.koha-commun |dc...@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added See Also||https://bugs.koha-community ||.org/bugzilla3/show_bug.cgi ||?id=30486 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 --- Comment #1 from David Cook --- Created attachment 152479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152479=edit Bug 34064: Add an audit script to compare database with kohastructure.sql This script can take a connected database handle and compare that database schema against kohastructure.sql to see what changes the database would need in order to match kohastructure.sql NOTE: It uses SQL::Translation::Diff, which is installed with DBIx::Class. WARNING: The diff doesn't seem to compare comments, so that difference won't appear in the output. If we wanted, we could easily enhance the audit_database.pl script to also compare comments. WARNING: The output is a proposed series of SQL commands. While they are useful to review, they won't always duplicate the changes done by updatedatabase.pl, so it's important to carefully analyze the output. The key purpose of this audit script is to just highlight the differences between the two. Test plan: 0. Apply patch 1. vi ./installer/data/mysql/kohastructure.sql 2. Comment out some columns, change NULL status, or whatever you like 3. perl misc/maintenance/audit_database.pl \ --filename /kohadevbox/koha/installer/data/mysql/kohastructure.sql 4. Note that the output includes SQL commands to change the database to match the new kohastructure.sql -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 34064] Compare kohastructure.sql against current database using database audit script
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34064 David Cook changed: What|Removed |Added Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/