Bug 23092: Add 'daterequested' to branchtransfers table

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2020-01-17 12:04:07 +00:00 committed by Jonathan Druart
parent e14c1702b4
commit 4eac229859
3 changed files with 35 additions and 2 deletions

View file

@ -36,6 +36,13 @@ __PACKAGE__->table("branchtransfers");
is_foreign_key: 1
is_nullable: 0
=head2 daterequested
data_type: 'timestamp'
datetime_undef_if_invalid: 1
default_value: current_timestamp
is_nullable: 0
=head2 datesent
data_type: 'datetime'
@ -87,6 +94,13 @@ __PACKAGE__->add_columns(
is_foreign_key => 1,
is_nullable => 0,
},
"daterequested",
{
data_type => "timestamp",
datetime_undef_if_invalid => 1,
default_value => \"current_timestamp",
is_nullable => 0,
},
"datesent",
{
data_type => "datetime",
@ -197,8 +211,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-20 11:24:33
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:50FpCj6vWH5O8MThCy/1hA
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-20 12:30:59
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:G5GZTxF8X/mcIKXmuGVWIQ
sub koha_object_class {
'Koha::Item::Transfer';

View file

@ -0,0 +1,18 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
unless ( column_exists('branchtransfers', 'daterequested') ) {
$dbh->do(
qq{
ALTER TABLE branchtransfers
ADD
`daterequested` timestamp NOT NULL default CURRENT_TIMESTAMP
AFTER
`itemnumber`
}
);
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 23092 - Add 'daterequested' field to transfers table)\n";
}

View file

@ -925,6 +925,7 @@ DROP TABLE IF EXISTS `branchtransfers`;
CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches
`branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key
`itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber)
`daterequested` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date the transfer was requested
`datesent` datetime default NULL, -- the date the transfer was initialized
`frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from
`datearrived` datetime default NULL, -- the date the transfer arrived at its destination