Bugzilla – Attachment 100806 Details for
Bug 22784
Add the ability to archive purchase suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22784: DB Changes
Bug-22784-DB-Changes.patch (text/plain), 2.56 KB, created by
Jonathan Druart
on 2020-03-16 18:07:15 UTC
(
hide
)
Description:
Bug 22784: DB Changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-16 18:07:15 UTC
Size:
2.56 KB
patch
obsolete
>From beb2abe41fd95d4ffa23389fa2e90f8b9f9455a4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 13 Nov 2019 15:06:23 +0100 >Subject: [PATCH] Bug 22784: DB Changes >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Sponsored-by: BULAC - http://www.bulac.fr/ >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > Koha/Schema/Result/Suggestion.pm | 4 ++++ > installer/data/mysql/atomicupdate/bug_22784.perl | 11 +++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 3 files changed, 16 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_22784.perl > >diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm >index a3771b2aab..7d6e57b27d 100644 >--- a/Koha/Schema/Result/Suggestion.pm >+++ b/Koha/Schema/Result/Suggestion.pm >@@ -491,6 +491,10 @@ __PACKAGE__->belongs_to( > }, > ); > >+__PACKAGE__->add_columns( >+ '+archived' => { is_boolean => 1 }, >+); >+ > sub koha_objects_class { > 'Koha::Suggestions'; > } >diff --git a/installer/data/mysql/atomicupdate/bug_22784.perl b/installer/data/mysql/atomicupdate/bug_22784.perl >new file mode 100644 >index 0000000000..ca7a68a08d >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22784.perl >@@ -0,0 +1,11 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ if( !column_exists( 'suggestions', 'archived' ) ) { >+ $dbh->do(q| >+ ALTER TABLE suggestions ADD COLUMN archived INT(1) NOT NULL DEFAULT 0 AFTER `STATUS`; >+ |); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 22784 - Add a new suggestions.archived column)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c6b82cbfe6..ea25e8c17e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2999,6 +2999,7 @@ CREATE TABLE `suggestions` ( -- purchase suggestions > lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time > lastmodificationdate date default NULL, -- date of the last modification > `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED) >+ `archived` INT(1) NOT NULL DEFAULT 0, -- is the suggestion archived? > `note` LONGTEXT, -- note entered on the suggestion > `author` varchar(80) default NULL, -- author of the suggested item > `title` varchar(255) default NULL, -- title of the suggested item >-- >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 22784
:
95499
|
95500
|
95501
|
95502
|
95510
|
95511
|
95512
|
95513
|
95533
|
95534
|
95535
|
95536
|
95537
|
95538
|
96900
|
96901
|
96902
|
96903
|
96904
|
96905
|
100806
|
100807
|
100808
|
100809
|
100810
|
100811
|
100854
|
100855
|
100856
|
100857
|
100858
|
100859
|
101948
|
102779
|
102780
|
102781
|
102782
|
102783
|
102784
|
102785
|
102786
|
102944