Bugzilla – Attachment 109354 Details for
Bug 21066
Replace opac_news.timestamp by published_on and add updated_on as timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21066: (QA follow-up) Check for field existence in dbrev
Bug-21066-QA-follow-up-Check-for-field-existence-i.patch (text/plain), 1.59 KB, created by
Marcel de Rooy
on 2020-08-31 11:53:22 UTC
(
hide
)
Description:
Bug 21066: (QA follow-up) Check for field existence in dbrev
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-08-31 11:53:22 UTC
Size:
1.59 KB
patch
obsolete
>From 66c1d648b71c7fd5a31d22f699ed4c8a0e7bc3a6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 31 Aug 2020 08:21:34 +0000 >Subject: [PATCH] Bug 21066: (QA follow-up) Check for field existence in dbrev >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run the upgrade twice. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > installer/data/mysql/atomicupdate/bug_21066.perl | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_21066.perl b/installer/data/mysql/atomicupdate/bug_21066.perl >index 3a9780f78d..630f6d270b 100644 >--- a/installer/data/mysql/atomicupdate/bug_21066.perl >+++ b/installer/data/mysql/atomicupdate/bug_21066.perl >@@ -1,9 +1,16 @@ > $DBversion = 'XXX'; # will be replaced by the RM > if( CheckVersion( $DBversion ) ) { >- $dbh->do(q| >- ALTER TABLE opac_news >- CHANGE COLUMN timestamp publicationdate date DEFAULT NULL, >- ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP >- |); >+ if( column_exists( 'opac_news', 'timestamp' ) ) { >+ $dbh->do(q| >+ ALTER TABLE opac_news >+ CHANGE COLUMN timestamp publicationdate date DEFAULT NULL >+ |); >+ } >+ if( !column_exists( 'opac_news', 'updated_on' ) ) { >+ $dbh->do(q| >+ ALTER TABLE opac_news >+ ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER publicationdate >+ |); >+ } > NewVersion( $DBversion, 21066, "Update table opac_news"); > } >-- >2.11.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 21066
:
77037
|
77038
|
77039
|
107769
|
107770
|
107771
|
107772
|
107773
|
107774
|
107775
|
107776
|
109148
|
109149
|
109150
|
109151
|
109152
|
109153
|
109154
|
109192
|
109193
|
109194
|
109195
|
109196
|
109197
|
109198
|
109199
| 109354 |
109514
|
109515