|
Lines 12-20
return {
Link Here
|
| 12 |
$dbh->do( |
12 |
$dbh->do( |
| 13 |
q{ |
13 |
q{ |
| 14 |
ALTER TABLE bookings |
14 |
ALTER TABLE bookings |
| 15 |
ADD COLUMN `pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for booking pickup library' AFTER `item_id`, |
15 |
ADD COLUMN `pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for booking pickup library' AFTER `item_id` |
| 16 |
ADD CONSTRAINT `bookings_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE |
16 |
} |
| 17 |
} |
|
|
| 18 |
) == 1 |
17 |
) == 1 |
| 19 |
&& say_success( $out, "Added column 'bookings.pickup_library_id'" ); |
18 |
&& say_success( $out, "Added column 'bookings.pickup_library_id'" ); |
| 20 |
|
19 |
|
|
Lines 59-63
return {
Link Here
|
| 59 |
} |
58 |
} |
| 60 |
) == 1 && say_success( $out, "Updated column 'bookings.pickup_library_id' to NOT NULL" ); |
59 |
) == 1 && say_success( $out, "Updated column 'bookings.pickup_library_id' to NOT NULL" ); |
| 61 |
} |
60 |
} |
|
|
61 |
|
| 62 |
unless ( foreign_key_exists( 'bookings', 'bookings_ibfk_4' ) ) { |
| 63 |
$dbh->do( |
| 64 |
q{ |
| 65 |
ALTER TABLE bookings |
| 66 |
ADD CONSTRAINT `bookings_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE |
| 67 |
} |
| 68 |
) == 1 |
| 69 |
&& say_success( $out, "Added foreign key 'bookings_ibfk_4' to column 'bookings.pickup_library_id'" ); |
| 70 |
} |
| 62 |
}, |
71 |
}, |
| 63 |
}; |
72 |
}; |
| 64 |
- |
|
|