Bugzilla – Attachment 174968 Details for
Bug 37592
Add a record of creation and modification to bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37592: (QA follow-up) Update db_rev to align DBIx::Class with database schema for creation_date, modification_date
Bug-37592-QA-follow-up-Update-dbrev-to-align-DBIxC.patch (text/plain), 2.33 KB, created by
Paul Derscheid
on 2024-11-25 11:32:16 UTC
(
hide
)
Description:
Bug 37592: (QA follow-up) Update db_rev to align DBIx::Class with database schema for creation_date, modification_date
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-11-25 11:32:16 UTC
Size:
2.33 KB
patch
obsolete
>From 0dccd472762a258224a8e7ab14bae07c4296a2ef Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Mon, 25 Nov 2024 11:30:29 +0000 >Subject: [PATCH] Bug 37592: (QA follow-up) Update db_rev to align DBIx::Class > with database schema for creation_date, modification_date > >- DBIx::Class appears to determine column nullability based on database metadata. > When columns are added via `ALTER TABLE` without explicitly specifying `NOT NULL`, > the metadata may indicate `IS_NULLABLE = "YES"`, causing DBIx::Class to generate > `is_nullable => 1` in the schema files. This behavior might not account for the > implicit `NOT NULL` enforcement of `DEFAULT CURRENT_TIMESTAMP`. >- Adding `NOT NULL` explicitly in the `ALTER TABLE` statements ensures the database > metadata reflects the intended constraints, potentially resolving this issue. >- Additionally, comments in the atomic update and `kohastructure.sql` are aligned > for consistency and clarity. >--- > installer/data/mysql/db_revs/240600029.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > mode change 100755 => 100644 installer/data/mysql/db_revs/240600029.pl > >diff --git a/installer/data/mysql/db_revs/240600029.pl b/installer/data/mysql/db_revs/240600029.pl >old mode 100755 >new mode 100644 >index 34130aa521..760561001f >--- a/installer/data/mysql/db_revs/240600029.pl >+++ b/installer/data/mysql/db_revs/240600029.pl >@@ -25,10 +25,10 @@ return { > } > > my $creation_date_statement = <<~'SQL'; >- ALTER TABLE bookings ADD COLUMN creation_date DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT 'The datetime for when a bookings was created' >+ ALTER TABLE bookings ADD COLUMN creation_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT 'the datetime for when a bookings was created' > SQL > my $modification_date_statement = <<~'SQL'; >- ALTER TABLE bookings ADD COLUMN modification_date DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'The datetime for when a booking has been updated' >+ ALTER TABLE bookings ADD COLUMN modification_date DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL COMMENT 'the datetime for when a booking has been updated' > SQL > if ( @{$existing_columns} == 0 ) { > $dbh->do("$creation_date_statement AFTER `end_date`"); >-- >2.39.5
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 37592
:
170144
|
170161
|
170763
|
171254
|
171376
|
171377
|
171378
|
171524
|
171645
| 174968 |
174969
|
174970
|
174971
|
174972
|
174973