Bugzilla – Attachment 170260 Details for
Bug 37601
Add status field to bookings table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37601: Add status field to bookings table
Bug-37601-Add-status-field-to-bookings-table.patch (text/plain), 2.57 KB, created by
Paul Derscheid
on 2024-08-13 10:08:46 UTC
(
hide
)
Description:
Bug 37601: Add status field to bookings table
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-08-13 10:08:46 UTC
Size:
2.57 KB
patch
obsolete
>From 8a2e24a15ece134f79dece9093581f71a207164e Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Tue, 13 Aug 2024 10:07:30 +0000 >Subject: [PATCH] Bug 37601: Add status field to bookings table > >--- > ...7601-add-status-field-to-bookings-table.pl | 28 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 2 files changed, 29 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_37601-add-status-field-to-bookings-table.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_37601-add-status-field-to-bookings-table.pl b/installer/data/mysql/atomicupdate/bug_37601-add-status-field-to-bookings-table.pl >new file mode 100644 >index 0000000000..24789a9f72 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_37601-add-status-field-to-bookings-table.pl >@@ -0,0 +1,28 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => '37601', >+ description => 'Add status column to bookings table', >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @{$args}{qw(dbh out)}; >+ >+ if ( column_exists( 'bookings', 'status' ) ) { >+ say_info( $out, q{Column 'status' already exists in 'bookings' table. Skipping...} ); >+ >+ return; >+ } >+ >+ my $after = 'AFTER' . ( column_exists( 'bookings', 'updated_at' ) ? q{`updated_at`} : q{`end_date`} ); >+ my $statement = <<~"SQL"; >+ ALTER TABLE `bookings` >+ ADD COLUMN `status` ENUM('created', 'cancelled') NOT NULL DEFAULT 'created' COMMENT 'current status of the booking' $after; >+ SQL >+ if ( $dbh->do($statement) ) { >+ say_success( $out, q{Added column 'bookings.status'} ); >+ } else { >+ say_failure( $out, q{Failed to add column 'bookings.status'} ); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 07b1e78e1f..e696657ea1 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1216,6 +1216,7 @@ CREATE TABLE `bookings` ( > `pickup_library_id` varchar(10) NOT NULL COMMENT 'Identifier for booking pickup library', > `start_date` datetime DEFAULT NULL COMMENT 'the start date of the booking', > `end_date` datetime DEFAULT NULL COMMENT 'the end date of the booking', >+ `status` enum('created', 'cancelled') NOT NULL DEFAULT 'created' COMMENT 'current status of the booking', > PRIMARY KEY (`booking_id`), > KEY `patron_id` (`patron_id`), > KEY `biblio_id` (`biblio_id`), >-- >2.46.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37601
:
170260
|
170767
|
171241
|
171380
|
171381
|
171382
|
171526
|
171527
|
171528
|
171653
|
171654
|
171655