Bugzilla – Attachment 80576 Details for
Bug 20772
Make request metadata editable and add price_paid field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20772: DBRev 18.06.00.041
Bug-20772-DBRev-180600041.patch (text/plain), 6.44 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-10-13 11:27:44 UTC
(
hide
)
Description:
Bug 20772: DBRev 18.06.00.041
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-10-13 11:27:44 UTC
Size:
6.44 KB
patch
obsolete
>From bdcc95870253e4b86cdbeb812a41d81794cea473 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sat, 13 Oct 2018 07:47:12 -0300 >Subject: [PATCH] Bug 20772: DBRev 18.06.00.041 > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha.pm | 2 +- > Koha/Schema/Result/Illrequest.pm | 12 +++++++-- > Koha/Schema/Result/Illrequestattribute.pm | 12 +++++++-- > ...-add-price_paid_column_to_illrequests.perl | 10 ------- > ...readonly-flag-to-illrequestattributes.perl | 11 -------- > installer/data/mysql/updatedatabase.pl | 26 +++++++++++++++++++ > 6 files changed, 47 insertions(+), 26 deletions(-) > delete mode 100644 installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl > delete mode 100644 installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl > >diff --git a/Koha.pm b/Koha.pm >index 7f769898fe..955dbf309f 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 = "18.06.00.040"; >+$VERSION = "18.06.00.041"; > > sub version { > return $VERSION; >diff --git a/Koha/Schema/Result/Illrequest.pm b/Koha/Schema/Result/Illrequest.pm >index 1b207ff002..3e8462c13b 100644 >--- a/Koha/Schema/Result/Illrequest.pm >+++ b/Koha/Schema/Result/Illrequest.pm >@@ -97,6 +97,12 @@ __PACKAGE__->table("illrequests"); > is_nullable: 1 > size: 20 > >+=head2 price_paid >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 20 >+ > =head2 notesopac > > data_type: 'mediumtext' >@@ -156,6 +162,8 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 1, size => 500 }, > "cost", > { data_type => "varchar", is_nullable => 1, size => 20 }, >+ "price_paid", >+ { data_type => "varchar", is_nullable => 1, size => 20 }, > "notesopac", > { data_type => "mediumtext", is_nullable => 1 }, > "notesstaff", >@@ -231,8 +239,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rh8DSs3xj3KRmyd7WNGDAg >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-01 02:46:41 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MMKr4JAAAsNnFcQn9SPTcw > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/Illrequestattribute.pm b/Koha/Schema/Result/Illrequestattribute.pm >index cb9cb182d7..b89de5bbd2 100644 >--- a/Koha/Schema/Result/Illrequestattribute.pm >+++ b/Koha/Schema/Result/Illrequestattribute.pm >@@ -41,6 +41,12 @@ __PACKAGE__->table("illrequestattributes"); > data_type: 'mediumtext' > is_nullable: 0 > >+=head2 readonly >+ >+ data_type: 'tinyint' >+ default_value: 1 >+ is_nullable: 0 >+ > =cut > > __PACKAGE__->add_columns( >@@ -55,6 +61,8 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 0, size => 200 }, > "value", > { data_type => "mediumtext", is_nullable => 0 }, >+ "readonly", >+ { data_type => "tinyint", default_value => 1, is_nullable => 0 }, > ); > > =head1 PRIMARY KEY >@@ -89,8 +97,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X9SxZP1PGXTwDJ6lUkx8Fg >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-05-17 09:17:53 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sFY1giVMz5AkXCPidhyGjw > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl b/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl >deleted file mode 100644 >index f7207926ab..0000000000 >--- a/installer/data/mysql/atomicupdate/bug_20772-add-price_paid_column_to_illrequests.perl >+++ /dev/null >@@ -1,10 +0,0 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >- >- if( !column_exists( 'illrequests', 'price_paid' ) ) { >- $dbh->do( "ALTER TABLE illrequests ADD COLUMN price_paid varchar(20) DEFAULT NULL AFTER 'cost'" ); >- } >- >- SetVersion( $DBversion ); >- print "Upgrade to $DBversion done (Bug 20772 - Add illrequest.price_paid column)\n"; >-} >diff --git a/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl b/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl >deleted file mode 100644 >index 7707bc55e8..0000000000 >--- a/installer/data/mysql/atomicupdate/bug_20772-add-readonly-flag-to-illrequestattributes.perl >+++ /dev/null >@@ -1,11 +0,0 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >- >- if( !column_exists( 'illrequestattributes', 'readonly' ) ) { >- $dbh->do( "ALTER TABLE illrequestattributes ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1 AFTER 'value'" ); >- $dbh->do( "UPDATE illrequestattributes SET readonly = 1" ); >- } >- >- SetVersion( $DBversion ); >- print "Upgrade to $DBversion done (Bug 20772 - Add illrequestattributes.readonly column)\n"; >-} >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6469f511d0..2f48eff6e7 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -16644,6 +16644,32 @@ if( CheckVersion( $DBversion ) ) { > SetVersion( $DBversion ); > } > >+$DBversion = '18.06.00.041'; >+if( CheckVersion( $DBversion ) ) { >+ >+ if( !column_exists( 'illrequests', 'price_paid' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE illrequests >+ ADD COLUMN price_paid varchar(20) DEFAULT NULL >+ AFTER cost >+ }); >+ } >+ >+ if( !column_exists( 'illrequestattributes', 'readonly' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE illrequestattributes >+ ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1 >+ AFTER value >+ }); >+ $dbh->do(q{ >+ UPDATE illrequestattributes SET readonly = 1 >+ }); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 20772 - Add illrequestattributes.readonly and illrequest.price_paid columns)\n"; >+} >+ > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. > >-- >2.19.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 20772
:
75491
|
75492
|
75493
|
75494
|
75495
|
75496
|
75497
|
75563
|
77230
|
77231
|
77232
|
77233
|
77234
|
77235
|
77236
|
77237
|
80010
|
80011
|
80012
|
80013
|
80014
|
80015
|
80016
|
80017
|
80027
|
80028
|
80029
|
80030
|
80031
|
80032
|
80033
|
80034
|
80035
|
80036
|
80037
|
80039
|
80041
|
80042
|
80043
|
80044
|
80045
|
80046
|
80051
|
80232
|
80566
|
80567
|
80568
|
80569
|
80570
|
80571
|
80572
|
80573
|
80574
|
80575
| 80576 |
80577