# - #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 = "19.12.00.014";
+$VERSION = "19.12.00.015";
sub version {
return $VERSION;
=head2 reason
data_type: 'enum'
- extra: {list => ["Manual"]}
+ extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation"]}
is_nullable: 1
=cut
"comments",
{ data_type => "longtext", is_nullable => 1 },
"reason",
- { data_type => "enum", extra => { list => ["Manual"] }, is_nullable => 1 },
+ {
+ data_type => "enum",
+ extra => {
+ list => ["Manual", "StockrotationAdvance", "StockrotationRepatriation"],
+ },
+ is_nullable => 1,
+ },
);
=head1 PRIMARY KEY
);
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-28 15:01:05
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vN1IPDN+R7eqJ9BxMdlg4A
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-28 15:04:48
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PD2BJD5BaNcemKr2k7zPGA
sub koha_object_class {
'Koha::Item::Transfer';
+++ /dev/null
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
- # Add stockrotation states to reason enum
- $dbh->do(
- qq{
- ALTER TABLE
- `branchtransfers`
- MODIFY COLUMN
- `reason` enum(
- 'Manual',
- 'StockrotationAdvance',
- 'StockrotationRepatriation'
- )
- AFTER `comments`
- }
- );
-
- # Move stockrotation states to reason field
- $dbh->do(
- qq{
- UPDATE
- `branchtransfers`
- SET
- `reason` = 'StockrotationAdvance',
- `comments` = NULL
- WHERE
- `comments` = 'StockrotationAdvance'
- }
- );
- $dbh->do(
- qq{
- UPDATE
- `branchtransfers`
- SET
- `reason` = 'StockrotationRepatriation',
- `comments` = NULL
- WHERE
- `comments` = 'StockrotationRepatriation'
- }
- );
-
- SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug 24296 - Update stockrotation to use 'reason' field in transfers table)\n";
-}
print "Upgrade to $DBversion done (Bug 24287 - Add 'reason' field to transfers table)\n";
}
+$DBversion = '19.12.00.015';
+if( CheckVersion( $DBversion ) ) {
+
+ # Add stockrotation states to reason enum
+ $dbh->do(
+ qq{
+ ALTER TABLE
+ `branchtransfers`
+ MODIFY COLUMN
+ `reason` enum(
+ 'Manual',
+ 'StockrotationAdvance',
+ 'StockrotationRepatriation'
+ )
+ AFTER `comments`
+ }
+ );
+
+ # Move stockrotation states to reason field
+ $dbh->do(
+ qq{
+ UPDATE
+ `branchtransfers`
+ SET
+ `reason` = 'StockrotationAdvance',
+ `comments` = NULL
+ WHERE
+ `comments` = 'StockrotationAdvance'
+ }
+ );
+ $dbh->do(
+ qq{
+ UPDATE
+ `branchtransfers`
+ SET
+ `reason` = 'StockrotationRepatriation',
+ `comments` = NULL
+ WHERE
+ `comments` = 'StockrotationRepatriation'
+ }
+ );
+
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 24296 - Update stockrotation to use 'reason' field in transfers table)\n";
+}
+
# 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/';