# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
-$VERSION = "18.12.00.019";
+$VERSION = "18.12.00.020";
sub version {
return $VERSION;
{ cascade_copy => 0, cascade_delete => 0 },
);
-=head2 branch_borrower_circ_rules
-
-Type: has_many
-
-Related object: L<Koha::Schema::Result::BranchBorrowerCircRule>
-
-=cut
-
-__PACKAGE__->has_many(
- "branch_borrower_circ_rules",
- "Koha::Schema::Result::BranchBorrowerCircRule",
- { "foreign.branchcode" => "self.branchcode" },
- { cascade_copy => 0, cascade_delete => 0 },
-);
-
=head2 branch_item_rules
Type: has_many
);
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-01-03 16:10:04
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WyXH3sMlyuJIx0fd31RswA
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-05 20:42:53
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nArzlMOpUO6oVOAZUgzSRg
__PACKAGE__->add_columns(
'+pickup_location' => { is_boolean => 1 }
{ cascade_copy => 0, cascade_delete => 0 },
);
-=head2 branch_borrower_circ_rules
-
-Type: has_many
-
-Related object: L<Koha::Schema::Result::BranchBorrowerCircRule>
-
-=cut
-
-__PACKAGE__->has_many(
- "branch_borrower_circ_rules",
- "Koha::Schema::Result::BranchBorrowerCircRule",
- { "foreign.categorycode" => "self.categorycode" },
- { cascade_copy => 0, cascade_delete => 0 },
-);
-
=head2 categories_branches
Type: has_many
{ cascade_copy => 0, cascade_delete => 0 },
);
-=head2 default_borrower_circ_rule
-
-Type: might_have
-
-Related object: L<Koha::Schema::Result::DefaultBorrowerCircRule>
-
-=cut
-
-__PACKAGE__->might_have(
- "default_borrower_circ_rule",
- "Koha::Schema::Result::DefaultBorrowerCircRule",
- { "foreign.categorycode" => "self.categorycode" },
- { cascade_copy => 0, cascade_delete => 0 },
-);
-
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-05 14:29:17
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yvHcgnSv1RXNMXJixVtt0Q
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-05 20:42:53
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XR5anXl3qCAm/Fa/l+zYpQ
# You can replace this text with custom content, and it will be preserved on regeneration
is_nullable: 0
size: 10
-=head2 maxissueqty
-
- data_type: 'integer'
- is_nullable: 1
-
-=head2 maxonsiteissueqty
-
- data_type: 'integer'
- is_nullable: 1
-
=head2 holdallowed
data_type: 'tinyint'
__PACKAGE__->add_columns(
"branchcode",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
- "maxissueqty",
- { data_type => "integer", is_nullable => 1 },
- "maxonsiteissueqty",
- { data_type => "integer", is_nullable => 1 },
"holdallowed",
{ data_type => "tinyint", is_nullable => 1 },
"hold_fulfillment_policy",
);
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-04-29 10:32:00
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wnrxD1/tp8X01YHmys02lg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-05 20:42:53
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SYfKl5LgCoDZVhPooF55SA
# You can replace this text with custom content, and it will be preserved on regeneration
extra: {list => ["singleton"]}
is_nullable: 0
-=head2 maxissueqty
-
- data_type: 'integer'
- is_nullable: 1
-
-=head2 maxonsiteissueqty
-
- data_type: 'integer'
- is_nullable: 1
-
=head2 holdallowed
data_type: 'integer'
extra => { list => ["singleton"] },
is_nullable => 0,
},
- "maxissueqty",
- { data_type => "integer", is_nullable => 1 },
- "maxonsiteissueqty",
- { data_type => "integer", is_nullable => 1 },
"holdallowed",
{ data_type => "integer", is_nullable => 1 },
"hold_fulfillment_policy",
__PACKAGE__->set_primary_key("singleton");
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-04-29 10:32:00
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fqBrj0c9h9c0eBlC0kG51w
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-05 20:42:53
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mrebGRlc4MORi6OtUk8NyA
# You can replace this text with custom content, and it will be preserved on regeneration
data_type: 'integer'
is_nullable: 1
-=head2 maxissueqty
-
- data_type: 'integer'
- is_nullable: 1
-
-=head2 maxonsiteissueqty
-
- data_type: 'integer'
- is_nullable: 1
-
=head2 issuelength
data_type: 'integer'
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
"accountsent",
{ data_type => "integer", is_nullable => 1 },
- "maxissueqty",
- { data_type => "integer", is_nullable => 1 },
- "maxonsiteissueqty",
- { data_type => "integer", is_nullable => 1 },
"issuelength",
{ data_type => "integer", is_nullable => 1 },
"lengthunit",
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-01-04 03:06:35
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:slPyHZs0YvOKev3cAxdDJQ
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-05 20:49:11
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6bPX0BRWWQZrWFun3GP86Q
# You can replace this text with custom code or comments, and it will be preserved on regeneration
+++ /dev/null
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
- if ( TableExists( 'branch_borrower_circ_rules' ) ) {
- if ( column_exists( 'branch_borrower_circ_rules', 'maxissueqty' ) ) {
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT categorycode, branchcode, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
- FROM branch_borrower_circ_rules
- ");
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT categorycode, branchcode, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
- FROM branch_borrower_circ_rules
- ");
- $dbh->do("DROP TABLE branch_borrower_circ_rules");
- }
- }
-
- if ( TableExists( 'default_borrower_circ_rules' ) ) {
- if ( column_exists( 'default_borrower_circ_rules', 'maxissueqty' ) ) {
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT categorycode, NULL, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
- FROM default_borrower_circ_rules
- ");
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT categorycode, NULL, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
- FROM default_borrower_circ_rules
- ");
- $dbh->do("DROP TABLE default_borrower_circ_rules");
- }
- }
-
- if ( column_exists( 'default_circ_rules', 'maxissueqty' ) ) {
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT NULL, NULL, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
- FROM default_circ_rules
- ");
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT NULL, NULL, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
- FROM default_circ_rules
- ");
- $dbh->do("ALTER TABLE default_circ_rules DROP COLUMN maxissueqty, DROP COLUMN maxonsiteissueqty");
- }
-
- if ( column_exists( 'default_branch_circ_rules', 'maxissueqty' ) ) {
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT NULL, branchcode, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
- FROM default_branch_circ_rules
- ");
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT NULL, NULL, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
- FROM default_branch_circ_rules
- ");
- $dbh->do("ALTER TABLE default_branch_circ_rules DROP COLUMN maxissueqty, DROP COLUMN maxonsiteissueqty");
- }
-
- if ( column_exists( 'issuingrules', 'maxissueqty' ) ) {
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT IF(categorycode='*', NULL, categorycode),
- IF(branchcode='*', NULL, branchcode),
- IF(itemtype='*', NULL, itemtype),
- 'maxissueqty',
- COALESCE( maxissueqty, '' )
- FROM issuingrules
- ");
- $dbh->do("
- INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
- SELECT IF(categorycode='*', NULL, categorycode),
- IF(branchcode='*', NULL, branchcode),
- IF(itemtype='*', NULL, itemtype),
- 'maxonsiteissueqty',
- COALESCE( maxonsiteissueqty, '' )
- FROM issuingrules
- ");
- $dbh->do("ALTER TABLE issuingrules DROP COLUMN maxissueqty, DROP COLUMN maxonsiteissueqty");
- }
-
- SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 18925 - Move maxissueqty and maxonsiteissueqty to circulation_rules)\n";
-}
print "Upgrade to $DBversion done (Bug 21728 - Add 'Reserve Fee' to the account_offset_types table if missing)\n";
}
+$DBversion = '18.12.00.020';
+if( CheckVersion( $DBversion ) ) {
+ if ( TableExists( 'branch_borrower_circ_rules' ) ) {
+ if ( column_exists( 'branch_borrower_circ_rules', 'maxissueqty' ) ) {
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT categorycode, branchcode, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
+ FROM branch_borrower_circ_rules
+ ");
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT categorycode, branchcode, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
+ FROM branch_borrower_circ_rules
+ ");
+ $dbh->do("DROP TABLE branch_borrower_circ_rules");
+ }
+ }
+
+ if ( TableExists( 'default_borrower_circ_rules' ) ) {
+ if ( column_exists( 'default_borrower_circ_rules', 'maxissueqty' ) ) {
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT categorycode, NULL, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
+ FROM default_borrower_circ_rules
+ ");
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT categorycode, NULL, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
+ FROM default_borrower_circ_rules
+ ");
+ $dbh->do("DROP TABLE default_borrower_circ_rules");
+ }
+ }
+
+ if ( column_exists( 'default_circ_rules', 'maxissueqty' ) ) {
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT NULL, NULL, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
+ FROM default_circ_rules
+ ");
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT NULL, NULL, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
+ FROM default_circ_rules
+ ");
+ $dbh->do("ALTER TABLE default_circ_rules DROP COLUMN maxissueqty, DROP COLUMN maxonsiteissueqty");
+ }
+
+ if ( column_exists( 'default_branch_circ_rules', 'maxissueqty' ) ) {
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT NULL, branchcode, NULL, 'patron_maxissueqty', COALESCE( maxissueqty, '' )
+ FROM default_branch_circ_rules
+ ");
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT NULL, NULL, NULL, 'patron_maxonsiteissueqty', COALESCE( maxonsiteissueqty, '' )
+ FROM default_branch_circ_rules
+ ");
+ $dbh->do("ALTER TABLE default_branch_circ_rules DROP COLUMN maxissueqty, DROP COLUMN maxonsiteissueqty");
+ }
+
+ if ( column_exists( 'issuingrules', 'maxissueqty' ) ) {
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT IF(categorycode='*', NULL, categorycode),
+ IF(branchcode='*', NULL, branchcode),
+ IF(itemtype='*', NULL, itemtype),
+ 'maxissueqty',
+ COALESCE( maxissueqty, '' )
+ FROM issuingrules
+ ");
+ $dbh->do("
+ INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
+ SELECT IF(categorycode='*', NULL, categorycode),
+ IF(branchcode='*', NULL, branchcode),
+ IF(itemtype='*', NULL, itemtype),
+ 'maxonsiteissueqty',
+ COALESCE( maxonsiteissueqty, '' )
+ FROM issuingrules
+ ");
+ $dbh->do("ALTER TABLE issuingrules DROP COLUMN maxissueqty, DROP COLUMN maxonsiteissueqty");
+ }
+
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 18925 - Move maxissueqty and maxonsiteissueqty to circulation_rules)\n";
+}
+
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.