}
if ( column_exists( 'issuingrules', 'maxissueqty' ) ) {
+ # Cleaning invalid rules before, to avoid FK contraints to fail
+ $dbh->do(q|
+ DELETE FROM issuingrules WHERE categorycode != '*' AND categorycode NOT IN (SELECT categorycode FROM categories);
+ |);
+ $dbh->do(q|
+ DELETE FROM issuingrules WHERE branchcode != '*' AND branchcode NOT IN (SELECT branchcode FROM branches);
+ |);
+ $dbh->do(q|
+ DELETE FROM issuingrules WHERE itemtype != '*' AND itemtype NOT IN (SELECT itemtype FROM itemtypes);
+ |);
+
$dbh->do("
INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
SELECT IF(categorycode='*', NULL, categorycode),
$DBversion = '18.12.00.024';
if ( CheckVersion($DBversion) ) {
+ # Fixup any pre-existing bad suggestedby, manageddate, accepteddate dates
+ $dbh->do(
+ "UPDATE suggestions SET suggesteddate = '1970-01-01' WHERE suggesteddate = '0000-00-00';"
+ );
+ $dbh->do(
+ "UPDATE suggestions SET manageddate = '1970-01-01' WHERE manageddate = '0000-00-00';"
+ );
+ $dbh->do(
+ "UPDATE suggestions SET accepteddate = '1970-01-01' WHERE accepteddate = '0000-00-00';"
+ );
+
# Add constraint for suggestedby
unless ( foreign_key_exists( 'suggestions', 'suggestions_ibfk_suggestedby' ) )
{
$dbh->do(q{UPDATE subscriptionhistory SET librariannote = NULL WHERE librariannote = ''});
SetVersion ($DBversion);
- print "Upgrade to $DBversion done (Bug 10215 - Increase the size of opacnote and librariannote for table subscriptionhistory)\n";
+ print "Upgrade to $DBversion done (Bug 10215: Increase the size of opacnote and librariannote for table subscriptionhistory)\n";
}
$DBversion = '19.06.00.003';
$dbh->do(q{UPDATE systempreferences SET value = REPLACE( value, ' ', '|' ) WHERE variable = 'UniqueItemFields'; });
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22867 - UniqueItemFields preference value should be pipe-delimited)\n";
+ print "Upgrade to $DBversion done (Bug 22867: UniqueItemFields preference value should be pipe-delimited)\n";
}
$DBversion = '19.06.00.004';
$dbh->do( 'UPDATE language_descriptions SET description = "Griechisch (Modern 1453-)"
WHERE subtag = "el" and type = "language" and lang ="de"' );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22770 - Fix typo in language description for el in German)\n";
+ print "Upgrade to $DBversion done (Bug 22770: Fix typo in language description for el in German)\n";
}
$DBversion = '19.06.00.005';
}
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 9834 - Add the reserves.item_level_hold column)\n";
+ print "Upgrade to $DBversion done (Bug 9834: Add the reserves.item_level_hold column)\n";
}
$DBversion = '19.06.00.006';
Koha::Plugins->new({ enable_plugins => 1 })->InstallPlugins;
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 21073 - Improve plugin performance)\n";
+ print "Upgrade to $DBversion done (Bug 21073: Improve plugin performance)\n";
}
$DBversion = '19.06.00.007';
if( CheckVersion( $DBversion ) ) {
$dbh->do( "DELETE FROM systempreferences WHERE variable = 'RotationPreventTransfers'" );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22653 - Remove unimplemented RotationPreventTransfers system preference)\n";
+ print "Upgrade to $DBversion done (Bug 22653: Remove unimplemented RotationPreventTransfers system preference)\n";
}
$DBversion = '19.06.00.008';
if( CheckVersion( $DBversion ) ) {
$dbh->do( "UPDATE userflags SET flagdesc = 'Allow staff members to modify permissions and passwords for other staff members' WHERE flag = 'staffaccess'" );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23109 - Improve description of staffaccess permission)\n";
+ print "Upgrade to $DBversion done (Bug 23109: Improve description of staffaccess permission)\n";
}
$DBversion = '19.06.00.009';
});
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 17178 - add shortcut to keyboard_shortcuts)\n";
+ print "Upgrade to $DBversion done (Bug 17178: add shortcut to keyboard_shortcuts)\n";
}
$DBversion = '19.06.00.010';
}
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 18928 - Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules)\n";
+ print "Upgrade to $DBversion done (Bug 18928: Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules)\n";
}
$DBversion = '19.06.00.011';
}
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 18930 - Move lost item refund rules to circulation_rules table)\n";
+ print "Upgrade to $DBversion done (Bug 18930: Move lost item refund rules to circulation_rules table)\n";
}
$DBversion = '19.06.00.012';
});
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 22563 - Fix accounttypes for 'L', 'LR' and 'CR')\n";
+ print "Upgrade to $DBversion done (Bug 22563: Fix accounttypes for 'L', 'LR' and 'CR')\n";
}
$DBversion = '19.06.00.013';
$dbh->do("ALTER TABLE borrower_modifications ADD changed_fields MEDIUMTEXT AFTER verification_token;");
}
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23151 - Add borrower_modifications.changed_fields column)\n";
+ print "Upgrade to $DBversion done (Bug 23151: Add borrower_modifications.changed_fields column)\n";
}
$DBversion = '19.06.00.014';
});
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 11573 - Fix accounttypes for 'Rent')\n";
+ print "Upgrade to $DBversion done (Bug 11573: Fix accounttypes for 'Rent')\n";
}
$DBversion = '19.06.00.015';
$dbh->do( "UPDATE `search_field` SET `name` = 'date-time-last-modified', `label` = 'date-time-last-modified' WHERE `name` = 'date/time-last-modified'" );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22524 - Fix date/time-last-modified search with Elasticsearch)\n";
+ print "Upgrade to $DBversion done (Bug 22524: Fix date/time-last-modified search with Elasticsearch)\n";
}
$DBversion = '19.06.00.016';
;|);
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23396 - Fix missing keyboard_shortcuts table)\n";
+ print "Upgrade to $DBversion done (Bug 23396: Fix missing keyboard_shortcuts table)\n";
}
$DBversion = '19.06.00.017';
}
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 22610 - Fix accounttypes for SIP2 payments)\n";
+ print "Upgrade to $DBversion done (Bug 22610: Fix accounttypes for SIP2 payments)\n";
}
$DBversion = '19.06.00.018';
SetVersion($DBversion);
print
-"Upgrade to $DBversion done (Bug 23228 - Add option to automatically display payment receipt for printing after making a payment)\n";
+"Upgrade to $DBversion done (Bug 23228: Add option to automatically display payment receipt for printing after making a payment)\n";
}
$DBversion = '19.06.00.020';
|);
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23416 - Add PreserveSerialNotes syspref)\n";
+ print "Upgrade to $DBversion done (Bug 23416: Add PreserveSerialNotes syspref)\n";
}
$DBversion = '19.06.00.021';
|);
# Always end with this (adjust the bug info)
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23309 - Can't add new subfields to bibliographic frameworks in strict mode)\n";
+ print "Upgrade to $DBversion done (Bug 23309: Can't add new subfields to bibliographic frameworks in strict mode)\n";
}
$DBversion = '19.06.00.022';
}
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 14570 - Make it possible to add multiple guarantors to a record)\n";
+ print "Upgrade to $DBversion done (Bug 14570: Make it possible to add multiple guarantors to a record)\n";
}
$DBversion = '19.06.00.023';
});
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22258 - Add ElasticsearchMARCFormat preference)\n";
+ print "Upgrade to $DBversion done (Bug 22258: Add ElasticsearchMARCFormat preference)\n";
}
$DBversion = '19.06.00.024';
$dbh->do(q{ALTER TABLE accountlines CHANGE COLUMN accounttype accounttype varchar(80) default NULL});
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23539 - accountlines.accounttype should match authorised_values.authorised_value in size)\n";
+ print "Upgrade to $DBversion done (Bug 23539: accountlines.accounttype should match authorised_values.authorised_value in size)\n";
}
$DBversion = '19.06.00.025';
if( CheckVersion( $DBversion ) ) {
$dbh->do( q/INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES (?, ?, ?, ?, ?)/, undef, 'BarcodeSeparators','\s\r\n','','Splitting characters for barcodes','Free' );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22996 - Add pref BarcodeSeparators)\n";
+ print "Upgrade to $DBversion done (Bug 22996: Add pref BarcodeSeparators)\n";
}
$DBversion = '19.06.00.026';
});
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 20691 - Add ability for guarantors to view guarantee's fines in OPAC)\n";
+ print "Upgrade to $DBversion done (Bug 20691: Add ability for guarantors to view guarantee's fines in OPAC)\n";
}
$DBversion = '19.06.00.027';
}
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 15497 - Add itemtypes_branches table)\n";
+ print "Upgrade to $DBversion done (Bug 15497: Add itemtypes_branches table)\n";
}
$DBversion = '19.06.00.028';
});
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 11573 - Fix accounttypes for 'A')\n";
+ print "Upgrade to $DBversion done (Bug 11573: Fix accounttypes for 'A')\n";
}
$DBversion = '19.06.00.029';
});
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 23321 - Add cash_registers table, permissions and preferences)\n";
+ print "Upgrade to $DBversion done (Bug 23321: Add cash_registers table, permissions and preferences)\n";
}
$DBversion = '19.06.00.030';
# Always end with this (adjust the bug info)
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 19618 - add club_holds tables)\n";
+ print "Upgrade to $DBversion done (Bug 19618: add club_holds tables)\n";
}
$DBversion = '19.06.00.031';
|);
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23566 - Add OPACDetailQRCode system preference)\n";
+ print "Upgrade to $DBversion done (Bug 23566: Add OPACDetailQRCode system preference)\n";
}
$DBversion = '19.06.00.032';
SetVersion($DBversion);
print
-"Upgrade to $DBversion done (Bug 20589 - Add field boosting and use elastic query fields parameter instead of depricated _all)\n";
+"Upgrade to $DBversion done (Bug 20589: Add field boosting and use elastic query fields parameter instead of depricated _all)\n";
}
$DBversion = '19.06.00.033';
});
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 21701 - PayPal return URL option)\n";
+ print "Upgrade to $DBversion done (Bug 21701: PayPal return URL option)\n";
}
$DBversion = '19.06.00.038';
if( CheckVersion( $DBversion ) ) {
$dbh->do( "UPDATE systempreferences SET variable='PatronAutoComplete' WHERE variable='CircAutocompl' LIMIT 1" );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23697 - Rename CircAutocompl system preference to PatronAutoComplete)\n";
+ print "Upgrade to $DBversion done (Bug 23697: Rename CircAutocompl system preference to PatronAutoComplete)\n";
}
$DBversion = '19.06.00.039';
;
|);
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 17179 - Add additional keyboard_shortcuts)\n";
+ print "Upgrade to $DBversion done (Bug 17179: Add additional keyboard_shortcuts)\n";
}
$DBversion = '19.06.00.040';
|);
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 17140 - Add pref to allow rounding fines at payment)\n";
+ print "Upgrade to $DBversion done (Bug 17140: Add pref to allow rounding fines at payment)\n";
}
$DBversion = '19.06.00.041';
});
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22445 - Add new pref *CustomCoverImages*)\n";
+ print "Upgrade to $DBversion done (Bug 22445: Add new pref *CustomCoverImages*)\n";
}
$DBversion = '19.06.00.043';
unless ( column_exists('accountlines', 'debit_type_code') ) {
$dbh->do(
qq{
- ALTER IGNORE TABLE accountlines
+ ALTER TABLE accountlines
ADD
debit_type_code varchar(80) DEFAULT NULL
AFTER
);
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 23049 - Add account debit_types)\n";
+ print "Upgrade to $DBversion done (Bug 23049: Add account debit_types)\n";
}
$DBversion = '19.06.00.044';
unless ( column_exists('accountlines', 'credit_type_code') ) {
$dbh->do(
qq{
- ALTER IGNORE TABLE accountlines
+ ALTER TABLE accountlines
ADD
credit_type_code varchar(80) DEFAULT NULL
AFTER
);
SetVersion($DBversion);
- print "Upgrade to $DBversion done (Bug 23805 - Add account credit_types)\n";
+ print "Upgrade to $DBversion done (Bug 23805: Add account credit_types)\n";
}
$DBversion = '19.06.00.045';
$dbh->do( "UPDATE systempreferences SET value = '2' WHERE value = '0' AND variable = 'UsageStats'" );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 23866 - Set HEA syspref to prompt for review)\n";
+ print "Upgrade to $DBversion done (Bug 23866: Set HEA syspref to prompt for review)\n";
}
$DBversion = '19.06.00.046';
# Always end with this (adjust the bug info)
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 15260 - Option for extended loan with useDaysMode)\n";
+ print "Upgrade to $DBversion done (Bug 15260: Option for extended loan with useDaysMode)\n";
}
$DBversion = '19.06.00.047';
SetVersion($DBversion);
print
-"Upgrade to $DBversion done (Bug 14697 - Extend and enhance 'Claims returned' lost status)\n";
+"Upgrade to $DBversion done (Bug 14697: Extend and enhance 'Claims returned' lost status)\n";
}
$DBversion = '19.06.00.048';
} );
SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 22581 - add new OPACShowMusicalInscripts and OPACPlayMusicalInscripts system preferences)\n";
+ print "Upgrade to $DBversion done (Bug 22581: add new OPACShowMusicalInscripts and OPACPlayMusicalInscripts system preferences)\n";
+}
+
+$DBversion = '19.06.00.049';
+if( CheckVersion( $DBversion ) ) {
+
+ $dbh->do(q{
+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
+ SELECT
+ 'SuspensionsCalendar',
+ IF( value='noFinesWhenClosed', 'noSuspensionsWhenClosed', 'ignoreCalendar'),
+ 'ignoreCalendar|noSuspensionsWhenClosed',
+ 'Specify whether to use the Calendar in calculating suspensions',
+ 'Choice'
+ FROM systempreferences
+ WHERE variable='finesCalendar';
+ });
+
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 13958: Add a SuspensionsCalendar syspref)\n";
+}
+
+$DBversion = '19.06.00.050';
+if( CheckVersion( $DBversion ) ) {
+ $dbh->do( q{
+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
+ VALUES ('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo')
+ });
+
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 23293: Add 'OPACFineNoRenewalsIncludeCredits' system preference)\n";
+}
+
+$DBversion = '19.11.00.000';
+if( CheckVersion( $DBversion ) ) {
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (19.11.00 release)\n";
+}
+
+$DBversion = '19.12.00.000';
+if( CheckVersion( $DBversion ) ) {
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Dobbie is a free elf...)\n";
+}
+
+$DBversion = '19.12.00.001';
+if( CheckVersion( $DBversion ) ) {
+ $dbh->do( "UPDATE marc_subfield_structure SET kohafield = NULL WHERE kohafield = 'bibliosubject.subject';" );
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 17831 - Remove non-existing bibliosubject.subject from frameworks)\n";
+}
+
+$DBversion = '19.12.00.002';
+if( CheckVersion( $DBversion ) ) {
+ $dbh->do(q{
+ UPDATE systempreferences SET
+ variable = 'AllowItemsOnHoldCheckoutSIP',
+ explanation = 'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.'
+ WHERE variable = 'AllowItemsOnHoldCheckout'
+ });
+
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 23233 - Rename AllowItemsOnHoldCheckout syspref)\n";
+}
+
+$DBversion = '19.12.00.003';
+if( CheckVersion( $DBversion ) ) {
+
+ if( !column_exists( 'library_groups', 'ft_local_hold_group' ) ) {
+ $dbh->do( "ALTER TABLE library_groups ADD COLUMN ft_local_hold_group tinyint(1) NOT NULL DEFAULT 0 AFTER ft_search_groups_staff" );
+ }
+
+ # Always end with this (adjust the bug info)
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 22284 - Add ft_local_hold_group column to library_groups)\n";
}
# SEE bug 13068