Bug 7413: Add "No renewal before" to the circulation and fine rules
[koha.git] / misc / devel / update_dbix_class_files.pl
1 #!/usr/bin/perl
2
3 # This file is part of Koha.
4 #
5 # Copyright (C) 2012 ByWater Solutions
6 # Copyright (C) 2013 Equinox Software, Inc.
7 #
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21 use Modern::Perl;
22 use DBIx::Class::Schema::Loader qw/ make_schema_at /;
23 use Getopt::Long;
24
25 my $path = "./";
26 my $db_driver = 'mysql';
27 my $db_host = 'localhost';
28 my $db_port = '3306';
29 my $db_name = '';
30 my $db_user = '';
31 my $db_passwd = '';
32 GetOptions(
33     "path=s"      => \$path,
34     "db_driver=s" => \$db_driver,
35     "db_host=s"   => \$db_host,
36     "db_port=s"   => \$db_port,
37     "db_name=s"   => \$db_name,
38     "db_user=s"   => \$db_user,
39     "db_passwd=s" => \$db_passwd,
40 );
41
42 make_schema_at(
43     "Koha::Schema",
44     {debug => 1, dump_directory => $path},
45     ["DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",$db_user, $db_passwd ]
46 );