Bugzilla – Attachment 171653 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.90 KB, created by
Paul Derscheid
on 2024-09-18 08:08:00 UTC
(
hide
)
Description:
Bug 37601: Add status field to bookings table
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-09-18 08:08:00 UTC
Size:
2.90 KB
patch
obsolete
>From 4ed06a3a9c74b8834570effef4d2b33c3fa61741 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 > >Signed-off-by: LEBSimonsen <simonsen@bz-sh.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > ...7601-add-status-field-to-bookings-table.pl | 28 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 29 insertions(+), 1 deletion(-) > 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 9a3661df15..cd3faf2d72 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1219,7 +1219,7 @@ CREATE TABLE `bookings` ( > `end_date` datetime DEFAULT NULL COMMENT 'the end date of the booking', > `creation_date` timestamp DEFAULT current_timestamp() COMMENT 'the timestamp for when a booking was created', > `modification_date` timestamp DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the timestamp for when a booking has been updated', >- `status` enum('created', 'cancelled') NOT NULL DEFAULT 'created' COMMENT 'current status of the booking', >+ `status` enum('new', 'cancelled', 'completed') 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.1
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