Summary: | update_dbix_class_files.pl loads defaults from ~/.my.cnf | ||
---|---|---|---|
Product: | Koha | Reporter: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Component: | Command-line Utilities | Assignee: | Galen Charlton <gmcharlt> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, julian.maurice, robin, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14967 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 18000 | ||
Bug Blocks: | |||
Attachments: | Bug 18229 - update_dbix_class_files.pl loads defaults from ~/.my.cnf |
Description
Olli-Antti Kivilahti
2017-03-08 15:21:58 UTC
Created attachment 60918 [details] [review] Bug 18229 - update_dbix_class_files.pl loads defaults from ~/.my.cnf A) Put this to your ~/.my.cnf [client] host = 10.0.3.10 port = 3306 user = koha_ci password = "Mr. senior plays with his junior" database = koha_ci B) Then run update_dbix_class_files.pl perl misc/devel/update_dbix_class_files.pl --tablename issuingrules C) Update DBIx::Class files like a boss See: commit e0b0ae20531736ede2cd1113baf16323cb69b3d9 bug 8798: (follow-up) pass DB connection params to DBIC schema updater explicitly This patch changes update_dbix_class_files.pl so that the connection parameters to the reference database must be passed explicitly via command-line switches, rather than grabbing them from the current Koha context. The purpose of this is to intentionally put up a roadblock to reduce the chance that a developer (or release manager) accidentally updates the schema files to include local testing cruft such as temporary tables. If you feel like that. I don't mind forking this feature. Actually I already wrote such a patch, but when I say Galen's patch I did not submit mine. I think this could be re-discussed. (In reply to Jonathan Druart from comment #4) > Actually I already wrote such a patch, but when I say Galen's patch I did > not submit mine. > > I think this could be re-discussed. Hmm.. I also wrote a similar patch (in bug 21177). We are at least 3 developers annoyed enough to have written a patch to change that. I think the reasoning behind this "roadblock" is not valid. Developers are lazy by definition, and if they are annoyed or frustrated by this they will quickly write a custom script to read $KOHA_CONF (or my.cnf) and call update_dbix_class_files.pl with the correct parameters (like this one: https://gitlab.com/snippets/1753594) Anyway the real danger is for people that push these modifications (RM and RMaint), and I think they know what they're doing. Now, about this particular bug, I think reading .my.cnf will not be useful for everyone. I, for instance, have several instances of Koha on the same host, and .my.cnf references my primary koha database. So if I'm working on another instance and forget to set --db_name, the script will update my local schema based on another database. So reading $KOHA_CONF would be better in my case. |