View | Details | Raw Unified | Return to bug 23092
Collapse All | Expand All

(-)a/Koha/Schema/Result/Branchtransfer.pm (-2 / +16 lines)
Lines 36-41 __PACKAGE__->table("branchtransfers"); Link Here
36
  is_foreign_key: 1
36
  is_foreign_key: 1
37
  is_nullable: 0
37
  is_nullable: 0
38
38
39
=head2 daterequested
40
41
  data_type: 'timestamp'
42
  datetime_undef_if_invalid: 1
43
  default_value: current_timestamp
44
  is_nullable: 0
45
39
=head2 datesent
46
=head2 datesent
40
47
41
  data_type: 'datetime'
48
  data_type: 'datetime'
Lines 87-92 __PACKAGE__->add_columns( Link Here
87
    is_foreign_key => 1,
94
    is_foreign_key => 1,
88
    is_nullable    => 0,
95
    is_nullable    => 0,
89
  },
96
  },
97
  "daterequested",
98
  {
99
    data_type => "timestamp",
100
    datetime_undef_if_invalid => 1,
101
    default_value => \"current_timestamp",
102
    is_nullable => 0,
103
  },
90
  "datesent",
104
  "datesent",
91
  {
105
  {
92
    data_type => "datetime",
106
    data_type => "datetime",
Lines 197-204 __PACKAGE__->belongs_to( Link Here
197
);
211
);
198
212
199
213
200
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-20 11:24:33
214
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-20 12:30:59
201
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:50FpCj6vWH5O8MThCy/1hA
215
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:G5GZTxF8X/mcIKXmuGVWIQ
202
216
203
sub koha_object_class {
217
sub koha_object_class {
204
    'Koha::Item::Transfer';
218
    'Koha::Item::Transfer';
(-)a/installer/data/mysql/atomicupdate/bug_23092.perl (+18 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    unless ( column_exists('branchtransfers', 'daterequested') ) {
5
        $dbh->do(
6
            qq{
7
                ALTER TABLE branchtransfers
8
                ADD
9
                  `daterequested` timestamp NOT NULL default CURRENT_TIMESTAMP
10
                AFTER
11
                  `itemnumber`
12
              }
13
        );
14
    }
15
16
    SetVersion( $DBversion );
17
    print "Upgrade to $DBversion done (Bug 23092 - Add 'daterequested' field to transfers table)\n";
18
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 925-930 DROP TABLE IF EXISTS `branchtransfers`; Link Here
925
CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches
925
CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches
926
  `branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key
926
  `branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key
927
  `itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber)
927
  `itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber)
928
  `daterequested` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date the transfer was requested
928
  `datesent` datetime default NULL, -- the date the transfer was initialized
929
  `datesent` datetime default NULL, -- the date the transfer was initialized
929
  `frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from
930
  `frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from
930
  `datearrived` datetime default NULL, -- the date the transfer arrived at its destination
931
  `datearrived` datetime default NULL, -- the date the transfer arrived at its destination
931
- 

Return to bug 23092