Bugzilla – Attachment 109514 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: DBRev 20.06.00.033
Bug-21066-DBRev-200600033.patch (text/plain), 4.02 KB, created by
Jonathan Druart
on 2020-09-02 12:36:55 UTC
(
hide
)
Description:
Bug 21066: DBRev 20.06.00.033
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-09-02 12:36:55 UTC
Size:
4.02 KB
patch
obsolete
>From 779df7f72805bebed9c8ef4e1f5d5f3caf64931c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 2 Sep 2020 14:05:13 +0200 >Subject: [PATCH] Bug 21066: DBRev 20.06.00.033 > >--- > Koha.pm | 2 +- > .../data/mysql/atomicupdate/bug_21066.perl | 16 ------------- > .../data/mysql/atomicupdate/bug_21066b.perl | 9 ------- > installer/data/mysql/updatedatabase.pl | 24 +++++++++++++++++++ > 4 files changed, 25 insertions(+), 26 deletions(-) > delete mode 100644 installer/data/mysql/atomicupdate/bug_21066.perl > delete mode 100644 installer/data/mysql/atomicupdate/bug_21066b.perl > >diff --git a/Koha.pm b/Koha.pm >index be102282dd..f21c90588c 100644 >--- a/Koha.pm >+++ b/Koha.pm >@@ -29,7 +29,7 @@ use vars qw{ $VERSION }; > # - #4 : the developer version. The 4th number is the database subversion. > # used by developers when the database changes. updatedatabase take care of the changes itself > # and is automatically called by Auth.pm when needed. >-$VERSION = "20.06.00.032"; >+$VERSION = "20.06.00.033"; > > sub version { > return $VERSION; >diff --git a/installer/data/mysql/atomicupdate/bug_21066.perl b/installer/data/mysql/atomicupdate/bug_21066.perl >deleted file mode 100644 >index 630f6d270b..0000000000 >--- a/installer/data/mysql/atomicupdate/bug_21066.perl >+++ /dev/null >@@ -1,16 +0,0 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >- 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"); >-} >diff --git a/installer/data/mysql/atomicupdate/bug_21066b.perl b/installer/data/mysql/atomicupdate/bug_21066b.perl >deleted file mode 100644 >index d99e79c54f..0000000000 >--- a/installer/data/mysql/atomicupdate/bug_21066b.perl >+++ /dev/null >@@ -1,9 +0,0 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >- $dbh->do(q| >- UPDATE letter >- SET content = REPLACE(content,?,?) >- WHERE content LIKE ? >- |, undef, 'opac_news.timestamp', 'opac_news.publicationdate', '%opac_news.timestamp%' ); >- NewVersion( $DBversion, 21066, "Replace timestamp references in letters table"); >-} >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 0a068f3f46..e6ea662310 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -22725,6 +22725,30 @@ if( CheckVersion( $DBversion ) ) { > NewVersion( $DBversion, 19889, "Add exclude_from_local_holds_priority column to items, deleteditems and categories tables"); > } > >+$DBversion = '20.06.00.033'; >+if( CheckVersion( $DBversion ) ) { >+ 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 >+ |); >+ } >+ >+ $dbh->do(q| >+ UPDATE letter >+ SET content = REPLACE(content,?,?) >+ WHERE content LIKE ? >+ |, undef, 'opac_news.timestamp', 'opac_news.publicationdate', '%opac_news.timestamp%' ); >+ >+ NewVersion( $DBversion, 21066, ["Update table opac_news", "Replace timestamp references in letters table"] ); >+} >+ > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. > my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; >-- >2.20.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 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