Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| booking_id | INT | 10 | √ | null |
|
|
primary key |
|||||||
| patron_id | INT | 10 | 0 |
|
|
foreign key from the borrowers table defining which patron this booking is for |
||||||||
| biblio_id | INT | 10 | 0 |
|
|
foreign key from the biblio table defining which bib record this booking is on |
||||||||
| item_id | INT | 10 | √ | NULL |
|
|
foreign key from the items table defining the specific item the patron has placed a booking for |
|||||||
| pickup_library_id | VARCHAR | 10 | null |
|
|
Identifier for booking pickup library |
||||||||
| start_date | DATETIME | 19 | √ | NULL |
|
|
the start date of the booking |
|||||||
| end_date | DATETIME | 19 | √ | NULL |
|
|
the end date of the booking |
|||||||
| creation_date | TIMESTAMP | 19 | current_timestamp() |
|
|
the timestamp for when a booking was created |
||||||||
| modification_date | TIMESTAMP | 19 | current_timestamp() |
|
|
the timestamp for when a booking has been updated |
||||||||
| status | enum('new', 'cancelled', 'completed') | 9 | 'new' |
|
|
current status of the booking |
||||||||
| cancellation_reason | VARCHAR | 80 | √ | NULL |
|
|
optional authorised value BOOKING_CANCELLATION |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| bookings_s_pk | Primary key | Asc | booking_id |
| biblio_id | Performance | Asc | biblio_id |
| bookings_ibfk_4 | Performance | Asc | pickup_library_id |
| item_id | Performance | Asc | item_id |
| patron_id | Performance | Asc | patron_id |
| PRIMARY | Must be unique | Asc | booking_id |



