[Bug 26947] New: kohastrcuture.sql should be updated for each release
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Bug ID: 26947 Summary: kohastrcuture.sql should be updated for each release Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The kohastructure.sql was originally a dump fo the database schema. Over time, however, it has been manually updated by developers as the tables were altered. Currently the file is out of order, and the conventions for punctuation and formatting are not standard. For instance, some numbers are quoted, some tables names are in backticks, some foreign keys are listed as 'CONSTRAINT' and some aren't The advantage to regenerating the file is that then users can dump their db schema and easily diff it against the expected structure to see what might be missing. Many DB updates simply don't add a new constraint if the existing data violates this, and as we use more Koha Objects, these missing constraints cause issues. We can add a script to kohadevbox or the release tools to make it easy to generate the new file and can add as a step in the release process -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au, | |jonathan.druart@bugs.koha-c | |ommunity.org, | |julian.maurice@biblibre.com | |, | |kyle@bywatersolutions.com, | |m.de.rooy@rijksmuseum.nl, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|kohastrcuture.sql should be |kohastructure.sql should be |updated for each release |updated for each release -- 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=26947 Nick Clemens <nick@bywatersolutions.com> 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 113603 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113603&action=edit Bug 26947: Add scheam-only option to koha-dump This patch adds a new --schema-only optoin to the koha-dump script. This can be used to generate a new kohastructure.sql file during the release, and later to compare the DB structure of a koha instance to the kohastructure.sql file shipped with a version to identify any missing constraints or other db structure issues To test: 1 - debian/scripts/koha-dump kohadev 2 - Confirm db and configs are dumped correctly 3 - Apply patch 4 - debian/scripts/koha-dump --help 5 - Confirm new option is listed and makes sense 6 - debian/scripts/koha-dump --schema-only kohadev 7 - Confirm only schema is dumped and is not zipped 8 - debian/scripts/koha-dump kohadev 9 - Confirm entire db is dumped as before -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- 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=26947 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_20_11_target Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=26947 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24658 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- On koha-testing-docker: root@kohadevbox:koha(master)$ perl debian/scripts/koha-dump --schema-only kohadev Dumping Koha site kohadev: * schema to /var/spool/koha/kohadev/kohadev-schema-2020-11-17.sql mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces Should not we have a bash function in ktd instead? Or a dev script in misc/devel? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #2)
On koha-testing-docker:
root@kohadevbox:koha(master)$ perl debian/scripts/koha-dump --schema-only kohadev Dumping Koha site kohadev: * schema to /var/spool/koha/kohadev/kohadev-schema-2020-11-17.sql mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
I was using MySQL8 and had to
GRANT USAGE, PROCESS ON *.* TO `koha_kohadev`@`%`;
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #2)
Should not we have a bash function in ktd instead? Or a dev script in misc/devel?
function update_kohastructure { mysqldump --databases -d --host=db --user=koha_kohadev --password=password koha_kohadev > installer/data/mysql/kohastructure.sql } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- C4::Installer::load_sql returned the following errors while attempting to load /kohadevbox/koha/installer/data/mysql/kohastructure.sql: DBD::mysql::st execute failed: Failed to open the referenced table 'branches' at /usr/share/perl5/DBIx/RunSQL.pm line 273. Something went wrong loading file /kohadevbox/koha/installer/data/mysql/kohastructure.sql ([SQL ERROR]: CREATE TABLE `account_credit_types_branches` ( Did it work for you? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #5)
C4::Installer::load_sql returned the following errors while attempting to load /kohadevbox/koha/installer/data/mysql/kohastructure.sql: DBD::mysql::st execute failed: Failed to open the referenced table 'branches' at /usr/share/perl5/DBIx/RunSQL.pm line 273. Something went wrong loading file /kohadevbox/koha/installer/data/mysql/kohastructure.sql ([SQL ERROR]: CREATE TABLE `account_credit_types_branches` (
Did it work for you?
Actually, the following works:
DROP DATABASE koha_kohadev CREATE DATABASE koha_kohadev koha-mysql kohadev < installer/data/mysql/kohastructure.sql
But reset_all does not, neither the installer (it says "Database tables created", but it's wrong...) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- My guess is that the following instruction line, from kohastructure.sql, is not read by DBIx::RunSQL 14 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; we load the schema from C4::Installer 282 my $error = $self->load_sql("$datadir/kohastructure.sql") -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Something along the line 'sed -r --in-place 's/,\s*-- (.*)$/ COMMENT "\1",/g;' installer/data/mysql/kohastructure.sql' should be used before the first run of this to capture our existing `, -- this is a comment` type comments and convert them to `COMMENT 'this is a comment',` so we keep the data and it also gets added to DBIC schemas as per the research undertaken by Victor: https://wiki.koha-community.org/wiki/User:Victor_Grousset_-_tuxayo/Coding_Gu... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I didn't find a way to export the schema in an order different than alpha. I may have missed something somewhere... but I read the mysqldump man page (as well as mydumper) and didn't find anything. I guess it's not possible as you could have two tables having each one relation to the other. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113794&action=edit Bug 26947: (follow-up) Set key checks to disabled for kohastructure -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Not entirely sure I like this approach.. it's very MySQL centric.. even MariaDB complains about some of the statements :(.. we can probably safely drop those, but I wasn't 100% sure what they did or why they appear in the dumpfile in the first place. The alternative is to fallback to using the system MySQL cli from the perl script.. but I don't really like that idea much either... so perhaps just falling back to disabling foreign key checks is the right thing to do here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Should not we only need to turn off FOREIGN_KEY_CHECKS? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #12)
Should not we only need to turn off FOREIGN_KEY_CHECKS?
I think you're probably right, I wasn't really sure why mysqldump turns so much else off.. I aim to try and understand that today and will quickly followup with details if I find any and likely re-submit that final patch with just the disablement of keys rather than all the other oddities. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113799 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113799&action=edit Bug 26947: Move -- comment to the COMMENT clause Sed command from bug 26947 comment 8 sed -r --in-place 's/,\s*-- (.*)$/ COMMENT "\1",/g;' installer/data/mysql/kohastructure.sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113800 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113800&action=edit Bug 26947: Replace double quotes from comments -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Martin, I wanted to try your sed command, it works pretty well! I only had to adjust manually 3 occurrences. Attaching the patches here but feel free to drop them if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113603|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113802 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113802&action=edit Bug 26947: Add scheam-only option to koha-dump This patch adds a new --schema-only optoin to the koha-dump script. This can be used to generate a new kohastructure.sql file during the release, and later to compare the DB structure of a koha instance to the kohastructure.sql file shipped with a version to identify any missing constraints or other db structure issues To test: 1 - debian/scripts/koha-dump kohadev 2 - Confirm db and configs are dumped correctly 3 - Apply patch 4 - debian/scripts/koha-dump --help 5 - Confirm new option is listed and makes sense 6 - debian/scripts/koha-dump --schema-only kohadev 7 - Confirm only schema is dumped and is not zipped 8 - debian/scripts/koha-dump kohadev 9 - Confirm entire db is dumped as before Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113794|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113803 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113803&action=edit Bug 26947: (follow-up) Set key checks to disabled for kohastructure This patch adds sql calls to disable foreign key checks for the initial kohastructure schema load and then re-enables them again for subsequent actions. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113799|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113804 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113804&action=edit Bug 26947: Move -- comment to the COMMENT clause Sed command from bug 26947 comment 8 sed -r --in-place 's/,\s*-- (.*)$/ COMMENT "\1",/g;' installer/data/mysql/kohastructure.sql Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113800|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 113805 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113805&action=edit Bug 26947: Replace double quotes from comments Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #4)
(In reply to Jonathan Druart from comment #2)
Should not we have a bash function in ktd instead? Or a dev script in misc/devel?
function update_kohastructure { mysqldump --databases -d --host=db --user=koha_kohadev --password=password koha_kohadev > installer/data/mysql/kohastructure.sql }
This one is better, but still not perfect: mysqldump --no-create-db --no-data --host=db --user=koha_kohadev --password=password koha_kohadev > installer/data/mysql/kohastructure.sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Martin Renvoize <martin.renvoize@ptfs-europe.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=26947 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #22 from Victor Grousset/tuxayo <victor@tuxayo.net> --- With the patch, the dump doesn't have the following part, is that expected? -- Current Database: `koha_kohadev` -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ `koha_kohadev` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `koha_kohadev`; -- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |The kohastructure file release notes| |which contains the table | |create statements for Koha | |was originally a MySQL dump | |which has been managed by | |hand as developers added | |new tables, changed | |columns, etc. | | | |In order to | |standardize this table and | |allow easy comparison of an | |existing sites database to | |the correct Koha structure | |this file should be | |automatically generated as | |part of the release process -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Victor Grousset/tuxayo from comment #22)
With the patch, the dump doesn't have the following part, is that expected?
-- Current Database: `koha_kohadev` --
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `koha_kohadev` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `koha_kohadev`;
--
Yes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #24 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nick, Martin, what is your opinion about koha-dump vs the bash alias? Or even a simple bash script in misc/devel that would generate it? I think the following line is more simple and maintainable than tweaking koha-dump mysqldump --no-create-db --no-data --host=db --user=koha_kohadev --password=password koha_kohadev -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #25 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #24)
Nick, Martin, what is your opinion about koha-dump vs the bash alias?
Or even a simple bash script in misc/devel that would generate it?
I think the following line is more simple and maintainable than tweaking koha-dump
mysqldump --no-create-db --no-data --host=db --user=koha_kohadev --password=password koha_kohadev
The reason I like koha-dump is that it allows for easy dumping of the existing database for comparison - it provides a tool that is the same used during releasing An alias/script can do the same, but isn't quite as easy I think. What is the argument against koha-dump? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Nick Clemens from comment #25)
An alias/script can do the same, but isn't quite as easy I think. What is the argument against koha-dump?
43 insertions(+), 26 deletions(-) in your patch, vs a 1 line change if we have an alias. I am ok with your changes if you think it will be easier as it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- And also make a 3rd place for RM tools (we already have the release-tools repo and the misc/devel dir). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #28 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 113989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113989&action=edit Bug 26947: Correct path for chown and chmod -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113802|0 |1 is obsolete| | --- Comment #29 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 114021 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114021&action=edit Bug 26947: Add scheam-only option to koha-dump This patch adds a new --schema-only optoin to the koha-dump script. This can be used to generate a new kohastructure.sql file during the release, and later to compare the DB structure of a koha instance to the kohastructure.sql file shipped with a version to identify any missing constraints or other db structure issues To test: 1 - debian/scripts/koha-dump kohadev 2 - Confirm db and configs are dumped correctly 3 - Apply patch 4 - debian/scripts/koha-dump --help 5 - Confirm new option is listed and makes sense 6 - debian/scripts/koha-dump --schema-only kohadev 7 - Confirm only schema is dumped and is not zipped 8 - debian/scripts/koha-dump kohadev 9 - Confirm entire db is dumped as before Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113803|0 |1 is obsolete| | --- Comment #30 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 114022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114022&action=edit Bug 26947: (follow-up) Set key checks to disabled for kohastructure This patch adds sql calls to disable foreign key checks for the initial kohastructure schema load and then re-enables them again for subsequent actions. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113804|0 |1 is obsolete| | --- Comment #31 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 114023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114023&action=edit Bug 26947: Move -- comment to the COMMENT clause Sed command from bug 26947 comment 8 sed -r --in-place 's/,\s*-- (.*)$/ COMMENT "\1",/g;' installer/data/mysql/kohastructure.sql Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113805|0 |1 is obsolete| | --- Comment #32 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 114024 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114024&action=edit Bug 26947: Replace double quotes from comments Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113989|0 |1 is obsolete| | --- Comment #33 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 114025 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114025&action=edit Bug 26947: Correct path for chown and chmod Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #34 from Victor Grousset/tuxayo <victor@tuxayo.net> --- As an help for QA, here is another signoff. QA script ok Note not directly related to this ticket: kohadev-XXXX-XX-XX.tar.gz, the file dump, doesn't have the right unix group. And both .gz files (file dump and db dump) don't have the right group once extracted. Not sure if that's an issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_11_target | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Kyle M Hall <kyle@bywatersolutions.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=26947 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114021|0 |1 is obsolete| | Attachment #114022|0 |1 is obsolete| | Attachment #114023|0 |1 is obsolete| | Attachment #114024|0 |1 is obsolete| | Attachment #114025|0 |1 is obsolete| | --- Comment #35 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 114195 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114195&action=edit Bug 26947: Add scheam-only option to koha-dump This patch adds a new --schema-only optoin to the koha-dump script. This can be used to generate a new kohastructure.sql file during the release, and later to compare the DB structure of a koha instance to the kohastructure.sql file shipped with a version to identify any missing constraints or other db structure issues To test: 1 - debian/scripts/koha-dump kohadev 2 - Confirm db and configs are dumped correctly 3 - Apply patch 4 - debian/scripts/koha-dump --help 5 - Confirm new option is listed and makes sense 6 - debian/scripts/koha-dump --schema-only kohadev 7 - Confirm only schema is dumped and is not zipped 8 - debian/scripts/koha-dump kohadev 9 - Confirm entire db is dumped as before Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #36 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 114196 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114196&action=edit Bug 26947: (follow-up) Set key checks to disabled for kohastructure This patch adds sql calls to disable foreign key checks for the initial kohastructure schema load and then re-enables them again for subsequent actions. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #37 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 114197 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114197&action=edit Bug 26947: Move -- comment to the COMMENT clause Sed command from bug 26947 comment 8 sed -r --in-place 's/,\s*-- (.*)$/ COMMENT "\1",/g;' installer/data/mysql/kohastructure.sql Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #38 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 114198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114198&action=edit Bug 26947: Replace double quotes from comments Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #39 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 114199 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114199&action=edit Bug 26947: Correct path for chown and chmod Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #40 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 114201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114201&action=edit Bug 26947: Update kohastructure.sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #41 from David Cook <dcook@prosentient.com.au> --- I haven't followed this change line by line, but does this mean that developers will no longer have to update kohastructure.sql? We'll just have to provide atomic updates? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #42 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Cook from comment #41)
I haven't followed this change line by line, but does this mean that developers will no longer have to update kohastructure.sql? We'll just have to provide atomic updates?
Changes to kohastructure.sql are still needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #43 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #42)
Changes to kohastructure.sql are still needed.
Ah, so is this change just about synchronizing kohastructure.sql with the output of a schema only koha-dump? Mostly just so RMs can do a sanity check? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #44 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I think Nick explained quite well the original need in comment 0:
Currently the file is out of order, and the conventions for punctuation and formatting are not standard. For instance, some numbers are quoted, some tables names are in backticks, some foreign keys are listed as 'CONSTRAINT' and some aren't
The advantage to regenerating the file is that then users can dump their db schema and easily diff it against the expected structure to see what might be missing.
Many DB updates simply don't add a new constraint if the existing data violates this, and as we use more Koha Objects, these missing constraints cause issues.
So it's a need for both standardisation/homogeneity and maintenance. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114195|0 |1 is obsolete| | Attachment #114196|0 |1 is obsolete| | Attachment #114197|0 |1 is obsolete| | Attachment #114198|0 |1 is obsolete| | Attachment #114199|0 |1 is obsolete| | Attachment #114201|0 |1 is obsolete| | --- Comment #45 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115065 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115065&action=edit Bug 26947: Add schema-only option to koha-dump This patch adds a new --schema-only optoin to the koha-dump script. This can be used to generate a new kohastructure.sql file during the release, and later to compare the DB structure of a koha instance to the kohastructure.sql file shipped with a version to identify any missing constraints or other db structure issues To test: 1 - debian/scripts/koha-dump kohadev 2 - Confirm db and configs are dumped correctly 3 - Apply patch 4 - debian/scripts/koha-dump --help 5 - Confirm new option is listed and makes sense 6 - debian/scripts/koha-dump --schema-only kohadev 7 - Confirm only schema is dumped and is not zipped 8 - debian/scripts/koha-dump kohadev 9 - Confirm entire db is dumped as before Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #46 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115066 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115066&action=edit Bug 26947: (follow-up) Set key checks to disabled for kohastructure This patch adds sql calls to disable foreign key checks for the initial kohastructure schema load and then re-enables them again for subsequent actions. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #47 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115067 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115067&action=edit Bug 26947: Move -- comment to the COMMENT clause Sed command from bug 26947 comment 8 sed -r --in-place 's/,\s*-- (.*)$/ COMMENT "\1",/g;' installer/data/mysql/kohastructure.sql Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #48 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115068 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115068&action=edit Bug 26947: Replace double quotes from comments Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #49 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115069 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115069&action=edit Bug 26947: Correct path for chown and chmod Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #50 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115070 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115070&action=edit Bug 26947: Update kohastructure.sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #51 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hum, I was going to push it and found: % diff /var/spool/koha/kohadev/kohadev-schema-2021-01-12.sql installer/data/mysql/kohastructure.sql 1c1 < -- MySQL dump 10.16 Distrib 10.1.47-MariaDB, for debian-linux-gnu (x86_64) ---
-- MariaDB dump 10.18 Distrib 10.5.8-MariaDB, for debian-linux-gnu (x86_64) 5c5 < -- Server version 10.1.48-MariaDB-1~bionic
-- Server version 10.3.27-MariaDB-1:10.3.27+maria~focal 28,31c28,31 < `can_be_added_manually` tinyint(4) NOT NULL DEFAULT '1', < `credit_number_enabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is autogeneration of credit number enabled for this credit type', < `is_system` tinyint(1) NOT NULL DEFAULT '0', < `archived` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'boolean flag to denote if this till is archived or not',
`can_be_added_manually` tinyint(4) NOT NULL DEFAULT 1, `credit_number_enabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Is autogeneration of credit number enabled for this credit type', `is_system` tinyint(1) NOT NULL DEFAULT 0, `archived` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to denote if this till is archived or not', [SKIP]
% diff /var/spool/koha/kohadev/kohadev-schema-2021-01-12.sql installer/data/mysql/kohastructure.sql | wc -l 1970 Default integer values got quoted in this version of MariaDB (10.1.48-MariaDB-1~bionic), but wasn't in newer version (10.3.27-MariaDB-1:10.3.27+maria~focal) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #52 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115073 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115073&action=edit Bug 26947: Remove AUTO_INCREMENT Sending a cake there https://bugs.mysql.com/bug.php?id=20786 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #53 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #51)
Default integer values got quoted in this version of MariaDB (10.1.48-MariaDB-1~bionic), but wasn't in newer version (10.3.27-MariaDB-1:10.3.27+maria~focal)
See https://jira.mariadb.org/browse/MDEV-15377 Deciding to push anyway, it will still be easier to compare and is going to be fixed with higher versions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.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=26947 --- Comment #54 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #55 from Fridolin Somers <fridolin.somers@biblibre.com> --- Oh big changes in a very important file. Is this safe for backport to stable branches ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #56 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Fridolin Somers from comment #55)
Oh big changes in a very important file. Is this safe for backport to stable branches ?
No, I would not backport it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #57 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Jonathan Druart from comment #56)
(In reply to Fridolin Somers from comment #55)
Oh big changes in a very important file. Is this safe for backport to stable branches ?
No, I would not backport it.
Ok no backport :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 koha-US bug tracker <bugzilla@koha-us.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@koha-us.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28471 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28471 [Bug 28471] koha-dump --schema-only does not work with mysqldump 8 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28749 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28749 [Bug 28749] All backups on 21.05 behave as if --without-db-name is passed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29605 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #58 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Reading this back while looking at changes between structure and actual tables, I am not so sure whether this patch (Move -- to COMMENT) was such a good idea. Note that this is an understatement. When you add a COMMENT to structure, you should add a db revision too with that clause for that field. Note that DBIx schema files also include those comments. Since this patch set only touched structure and did not add dbrev's, we will have as a result a very large set of differences between DBIx schema and the tables. I have been working on resolving differences for a 20.11 database, but I am now already looking forward to the massive output of the dbix script when I upgrade to 21.05 or higher ;) Note that running dbix script to get those differences would be very useful but will be hugely obscured by the move in this patch set. What can be done about it? Remove the COMMENT clauses again (revert) ? Adjust dbix script to remove comments (feels like a hack) ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #59 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- There are a few DBIx loader options that could be considered: generate_pod => 0 This seems to be overkill, too rigorous pod_comment_mode => switching between NAME and DESCRIPTION, not what we need table_comments_table and column_comments_table => adding those tables would make DBIx look first there instead of the COMMENT in the data source -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #60 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Ha, stumbled over this report again now. Why does 20.11 not accept my change in kohastructure, and why does master do? commit affa3164eb475ff09654c690c9df810be8dc670f Author: Martin Renvoize <martin.renvoize@ptfs-europe.com> Date: Wed Nov 18 17:08:11 2020 +0000 Bug 26947: (follow-up) Set key checks to disabled for kohastructure + # Disable checks before load + $self->{'dbh'}->do(q{SET NAMES utf8mb4}); + $self->{'dbh'}->do(q{SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0}); + $self->{'dbh'}->do(q{SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0}); + $self->{'dbh'}->do(q{SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'}); + $self->{'dbh'}->do(q{SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0}); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #61 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This latter change could have been backported since it actually resolves a problem that existed in Koha since we introduced DBIx::RunSQL. DBIx::RunSQL just silently ignore the first lines in kohastructure.sql that are dependent on version: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; I wonder if we should remove them from this sql file now, since they are misleading! They are never executed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30620 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #62 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #61)
This latter change could have been backported since it actually resolves a problem that existed in Koha since we introduced DBIx::RunSQL. DBIx::RunSQL just silently ignore the first lines in kohastructure.sql that are dependent on version:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
I wonder if we should remove them from this sql file now, since they are misleading! They are never executed.
Opened bug 30620 to add at least a comment leaving the possibility to run this directly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #63 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- And in line with the former comments, the following commit made lots of useless changes in kohastructure: commit 8c5845ef9ecd92584723cd60a221ecd4710a2516 Author: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Date: Fri Dec 4 15:39:32 2020 +0100 Bug 26947: Update kohastructure.sql The following pattern was added: -DROP TABLE IF EXISTS `auth_header`; -CREATE TABLE `auth_header` ( +DROP TABLE IF EXISTS `account_credit_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_credit_types` ( But note that if we run the file in the usual way via Installer, these lines with /*! pass DBIx::RunSQL and are just IGNORED ! They are useless ! Could you remove them, Jonathan ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #64 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #63)
And in line with the former comments, the following commit made lots of useless changes in kohastructure:
commit 8c5845ef9ecd92584723cd60a221ecd4710a2516 Author: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Date: Fri Dec 4 15:39:32 2020 +0100
Bug 26947: Update kohastructure.sql
The following pattern was added: -DROP TABLE IF EXISTS `auth_header`; -CREATE TABLE `auth_header` ( +DROP TABLE IF EXISTS `account_credit_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_credit_types` (
But note that if we run the file in the usual way via Installer, these lines with /*! pass DBIx::RunSQL and are just IGNORED ! They are useless !
Could you remove them, Jonathan ?
Ha copied the wrong DROP/CREATE example, but you ll probaly understand it :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #65 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #63)
And in line with the former comments, the following commit made lots of useless changes in kohastructure:
Could you remove them, Jonathan ?
As said on another bug report, this kohastructure.sql will be auto generated when 22.05.00 will be released. We should not add manual changes to it (apart from the usual changes). If you want to modify it you should adjust mysqldump's output (which was already not trivial if you read the previous comments). Or sed it and modify koha-dump. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32334 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26947 --- Comment #66 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- To still catch differences more easily, I will submitting some code on bug 32334 to sync the comments between actual database and schema. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org