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

(-)a/api/v1/swagger/definitions/booking.yaml (-4 / +4 lines)
Lines 18-29 properties: Link Here
18
    description: Internal item identifier
18
    description: Internal item identifier
19
    type:
19
    type:
20
      - integer
20
      - integer
21
      - "null"
21
      - 'null'
22
  item:
22
  item:
23
    description: Embedable item representation
23
    description: Embedable item representation
24
    type:
24
    type:
25
      - object
25
      - object
26
      - "null"
26
      - 'null'
27
  patron_id:
27
  patron_id:
28
    description: Internal patron identifier
28
    description: Internal patron identifier
29
    type: integer
29
    type: integer
Lines 31-37 properties: Link Here
31
    description: Embedable patron representation
31
    description: Embedable patron representation
32
    type:
32
    type:
33
      - object
33
      - object
34
      - "null"
34
      - 'null'
35
  pickup_library_id:
35
  pickup_library_id:
36
    description: Internal pickup_library identifier
36
    description: Internal pickup_library identifier
37
    type: string
37
    type: string
Lines 39-45 properties: Link Here
39
    description: Embedable pickup_library representation
39
    description: Embedable pickup_library representation
40
    type:
40
    type:
41
      - object
41
      - object
42
      - "null"
42
      - 'null'
43
  start_date:
43
  start_date:
44
    description: Start date and time of this booking
44
    description: Start date and time of this booking
45
    format: date-time
45
    format: date-time
(-)a/installer/data/mysql/atomicupdate/bug_36120.pl (-6 / +19 lines)
Lines 8-24 return { Link Here
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        unless ( column_exists( 'bookings', 'pickup_library_id' ) ) {
10
        unless ( column_exists( 'bookings', 'pickup_library_id' ) ) {
11
          $dbh->do(q{
11
            $dbh->do(
12
                q{
12
              ALTER TABLE bookings
13
              ALTER TABLE bookings
13
              ADD COLUMN `pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for booking pickup library' AFTER `item_id`,
14
              ADD COLUMN `pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for booking pickup library' AFTER `item_id`,
14
              ADD CONSTRAINT `bookings_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
15
              ADD CONSTRAINT `bookings_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
15
          });
16
          }
17
            );
16
18
17
          say $out "Added column 'bookings.pickup_library_id'";
19
            say $out "Added column 'bookings.pickup_library_id'";
18
20
19
          $dbh->do(
21
            $dbh->do(
20
              q{UPDATE bookings JOIN items ON bookings.item_id = items.itemnumber SET bookings.pickup_library_id = items.homebranch }
22
                q{UPDATE bookings JOIN items ON bookings.item_id = items.itemnumber SET bookings.pickup_library_id = items.homebranch }
21
          );
23
            );
24
25
            say $out "Set existing bookings pickup location to item homebranch";
26
27
            $dbh->do(
28
                q{
29
              ALTER TABLE bookings
30
              MODIFY pickup_library_id varchar(10) NOT NULL COMMENT 'Identifier for booking pickup library'
31
          }
32
            );
33
34
            say $out "Set pickup_library_id to NOT NULL";
22
        }
35
        }
23
    },
36
    },
24
};
37
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 1224-1230 CREATE TABLE `bookings` ( Link Here
1224
  `patron_id` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this booking is for',
1224
  `patron_id` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this booking is for',
1225
  `biblio_id` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this booking is on',
1225
  `biblio_id` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this booking is on',
1226
  `item_id` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed a booking for',
1226
  `item_id` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed a booking for',
1227
  `pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for booking pickup library',
1227
  `pickup_library_id` varchar(10) NOT NULL COMMENT 'Identifier for booking pickup library',
1228
  `start_date` datetime DEFAULT NULL COMMENT 'the start date of the booking',
1228
  `start_date` datetime DEFAULT NULL COMMENT 'the start date of the booking',
1229
  `end_date` datetime DEFAULT NULL COMMENT 'the end date of the booking',
1229
  `end_date` datetime DEFAULT NULL COMMENT 'the end date of the booking',
1230
  PRIMARY KEY (`booking_id`),
1230
  PRIMARY KEY (`booking_id`),
1231
- 

Return to bug 36120