From 97822f84cc4302ddb76939c623f769919bb72dd7 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 21 Sep 2012 12:16:04 -0400 Subject: [PATCH 2/2] [SIGNED-OFF] Bug 8798 - Add the use of DBIx::Class - Rename schema class updater updateDatabase.pl is a bit too close to updatedatabase.pl in installer and may cause some confusion. I would suggest update_dbix_class_files.pl as a unambiguous and descriptive name for this file. Signed-off-by: wajasu --- misc/devel/updateDatabase.pl | 28 ---------------------------- misc/devel/update_dbix_class_files.pl | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100755 misc/devel/updateDatabase.pl create mode 100755 misc/devel/update_dbix_class_files.pl diff --git a/misc/devel/updateDatabase.pl b/misc/devel/updateDatabase.pl deleted file mode 100755 index 83ac357..0000000 --- a/misc/devel/updateDatabase.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use C4::Context; -use DBIx::Class::Schema::Loader qw/ make_schema_at /; -use Getopt::Long; - -my $path = "./"; -GetOptions( - "path=s" => \$path, - ); -my $context = new C4::Context; -my $db_driver; -if ($context->config("db_scheme")){ - $db_driver=C4::Context->db_scheme2dbi($context->config("db_scheme")); -}else{ - $db_driver="mysql"; -} - - -my $db_name = $context->config("database"); -my $db_host = $context->config("hostname"); -my $db_port = $context->config("port") || ''; -my $db_user = $context->config("user"); -my $db_passwd = $context->config("pass"); - -make_schema_at("Koha::Schema", {debug => 1, dump_directory => $path}, ["DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",$db_user, $db_passwd ]); diff --git a/misc/devel/update_dbix_class_files.pl b/misc/devel/update_dbix_class_files.pl new file mode 100755 index 0000000..83ac357 --- /dev/null +++ b/misc/devel/update_dbix_class_files.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use C4::Context; +use DBIx::Class::Schema::Loader qw/ make_schema_at /; +use Getopt::Long; + +my $path = "./"; +GetOptions( + "path=s" => \$path, + ); +my $context = new C4::Context; +my $db_driver; +if ($context->config("db_scheme")){ + $db_driver=C4::Context->db_scheme2dbi($context->config("db_scheme")); +}else{ + $db_driver="mysql"; +} + + +my $db_name = $context->config("database"); +my $db_host = $context->config("hostname"); +my $db_port = $context->config("port") || ''; +my $db_user = $context->config("user"); +my $db_passwd = $context->config("pass"); + +make_schema_at("Koha::Schema", {debug => 1, dump_directory => $path}, ["DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",$db_user, $db_passwd ]); -- 1.7.12.1