# - #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 = "21.06.00.012";
+$VERSION = "21.06.00.013";
sub version {
return $VERSION;
+++ /dev/null
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
- # Remove foreign key for offset types
- if ( foreign_key_exists( 'account_offsets', 'account_offsets_ibfk_t' ) ) {
- $dbh->do( "ALTER TABLE account_offsets DROP FOREIGN KEY account_offsets_ibfk_t" );
- }
-
- # Drop account_offset_types table
- $dbh->do( "DROP TABLE IF EXISTS account_offset_types" );
-
- # Update offset_types to 'CREATE' where appropriate
- $dbh->do( "UPDATE account_offsets SET type = 'CREATE' WHERE type != 'OVERDUE_INCREASE' AND type != 'OVERDUE_DECREASE' AND ( debit_id IS NULL OR credit_id IS NULL)" );
- $dbh->do( "UPDATE account_offsets SET amount = ABS(amount) WHERE type = 'CREATE'" );
-
- # Update offset_types to 'APPLY' where appropriate
- $dbh->do( "UPDATE account_offsets SET type = 'APPLY' WHERE type != 'OVERDUE_INCREASE' AND type != 'OVERDUE_DECREASE' AND type != 'CREATE' AND type != 'VOID'" );
-
- # Update table to ENUM
- $dbh->do(
- q{
- ALTER TABLE
- `account_offsets`
- MODIFY COLUMN
- `type` enum(
- 'CREATE',
- 'APPLY',
- 'VOID',
- 'OVERDUE_INCREASE',
- 'OVERDUE_DECREASE'
- )
- AFTER `debit_id`
- }
- );
-
-
- NewVersion( $DBversion, 22435, "Update existing offsets");
-}
NewVersion( $DBversion, 15067, "Add missing languages" );
}
+$DBversion = '21.06.00.013';
+if( CheckVersion( $DBversion ) ) {
+ # Remove foreign key for offset types
+ if ( foreign_key_exists( 'account_offsets', 'account_offsets_ibfk_t' ) ) {
+ $dbh->do( "ALTER TABLE account_offsets DROP FOREIGN KEY account_offsets_ibfk_t" );
+ }
+
+ # Drop account_offset_types table
+ $dbh->do( "DROP TABLE IF EXISTS account_offset_types" );
+
+ # Update offset_types to 'CREATE' where appropriate
+ $dbh->do( "UPDATE account_offsets SET type = 'CREATE' WHERE type != 'OVERDUE_INCREASE' AND type != 'OVERDUE_DECREASE' AND ( debit_id IS NULL OR credit_id IS NULL)" );
+ $dbh->do( "UPDATE account_offsets SET amount = ABS(amount) WHERE type = 'CREATE'" );
+
+ # Update offset_types to 'APPLY' where appropriate
+ $dbh->do( "UPDATE account_offsets SET type = 'APPLY' WHERE type != 'OVERDUE_INCREASE' AND type != 'OVERDUE_DECREASE' AND type != 'CREATE' AND type != 'VOID'" );
+
+ # Update table to ENUM
+ $dbh->do(
+ q{
+ ALTER TABLE
+ `account_offsets`
+ MODIFY COLUMN
+ `type` enum(
+ 'CREATE',
+ 'APPLY',
+ 'VOID',
+ 'OVERDUE_INCREASE',
+ 'OVERDUE_DECREASE'
+ )
+ AFTER `debit_id`
+ }
+ );
+
+
+ NewVersion( $DBversion, 22435, "Update existing offsets");
+}
+
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';