Bugzilla – Attachment 90650 Details for
Bug 21073
Improve plugin performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21073: Add new table, schema and classes
Bug-21073-Add-new-table-schema-and-classes.patch (text/plain), 6.35 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-06-17 11:21:10 UTC
(
hide
)
Description:
Bug 21073: Add new table, schema and classes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-06-17 11:21:10 UTC
Size:
6.35 KB
patch
obsolete
>From 464b966b58f8944641d53f6aff0f68059f9b6966 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 13 Jul 2018 08:55:32 -0400 >Subject: [PATCH] Bug 21073: Add new table, schema and classes > >Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Plugins/Method.pm | 44 ++++++++++++ > Koha/Plugins/Methods.pm | 50 ++++++++++++++ > Koha/Schema/Result/PluginMethod.pm | 67 +++++++++++++++++++ > .../mysql/atomicupdate/plugin_methods.perl | 18 +++++ > installer/data/mysql/kohastructure.sql | 10 +++ > 5 files changed, 189 insertions(+) > create mode 100644 Koha/Plugins/Method.pm > create mode 100644 Koha/Plugins/Methods.pm > create mode 100644 Koha/Schema/Result/PluginMethod.pm > create mode 100644 installer/data/mysql/atomicupdate/plugin_methods.perl > >diff --git a/Koha/Plugins/Method.pm b/Koha/Plugins/Method.pm >new file mode 100644 >index 0000000000..83c2d70dfe >--- /dev/null >+++ b/Koha/Plugins/Method.pm >@@ -0,0 +1,44 @@ >+package Koha::Plugins::Method; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::Plugin::Method - Koha Plugin Method Object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'PluginMethod'; >+} >+ >+1; >diff --git a/Koha/Plugins/Methods.pm b/Koha/Plugins/Methods.pm >new file mode 100644 >index 0000000000..af56308ba6 >--- /dev/null >+++ b/Koha/Plugins/Methods.pm >@@ -0,0 +1,50 @@ >+package Koha::Plugins::Methods; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::City; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::Plugin::Methods - Koha City Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'PluginMethod'; >+} >+ >+sub object_class { >+ return 'Koha::Plugin::Method'; >+} >+ >+1; >diff --git a/Koha/Schema/Result/PluginMethod.pm b/Koha/Schema/Result/PluginMethod.pm >new file mode 100644 >index 0000000000..a36cfb0ba0 >--- /dev/null >+++ b/Koha/Schema/Result/PluginMethod.pm >@@ -0,0 +1,67 @@ >+use utf8; >+package Koha::Schema::Result::PluginMethod; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::PluginMethod >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<plugin_methods> >+ >+=cut >+ >+__PACKAGE__->table("plugin_methods"); >+ >+=head1 ACCESSORS >+ >+=head2 plugin_class >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 255 >+ >+=head2 plugin_method >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 255 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "plugin_class", >+ { data_type => "varchar", is_nullable => 0, size => 255 }, >+ "plugin_method", >+ { data_type => "varchar", is_nullable => 0, size => 255 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</plugin_class> >+ >+=item * L</plugin_method> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("plugin_class", "plugin_method"); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-07-13 12:37:57 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:koGk3Dh0wkslqYPUqUcK0w >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/installer/data/mysql/atomicupdate/plugin_methods.perl b/installer/data/mysql/atomicupdate/plugin_methods.perl >new file mode 100644 >index 0000000000..03f80a9d11 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/plugin_methods.perl >@@ -0,0 +1,18 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ $dbh->do(q{ >+ CREATE TABLE IF NOT EXISTS plugin_methods ( >+ plugin_class varchar(255) NOT NULL, >+ plugin_method varchar(255) NOT NULL, >+ PRIMARY KEY ( `plugin_class` (191), `plugin_method` (191) ) >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ >+ require Koha::Plugins; >+ Koha::Plugins->new()->InstallPlugins; >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e3d0930369..2aa2412379 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3535,6 +3535,16 @@ CREATE TABLE patron_consent ( > FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >+-- >+-- Table structure for table 'plugin_data' >+-- >+ >+CREATE TABLE IF NOT EXISTS plugin_methods ( >+ plugin_class varchar(255) NOT NULL, >+ plugin_method varchar(255) NOT NULL, >+ PRIMARY KEY ( `plugin_class` (191), `plugin_method` (191) ) >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ > -- > -- Table structure for table `patron_lists` > -- >-- >2.22.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 21073
:
76955
|
76956
|
76957
|
76958
|
76973
|
88379
|
88380
|
88381
|
89247
|
89251
|
89252
|
89255
|
89256
|
89272
|
89273
|
89274
|
89275
|
89276
|
89277
|
89278
|
89279
|
89786
|
89800
|
89801
|
89802
|
89803
|
89804
|
89805
|
89806
|
89807
|
89808
|
90630
|
90631
|
90650
|
90651
|
90652
|
90653
|
90654
|
90655
|
90656
|
90657
|
90658
|
90659
|
90660
|
90661
|
90662
|
90663
|
90664
|
90724
|
90725
|
90726
|
90727
|
90728
|
90729
|
90730
|
90731
|
90732
|
90733
|
90734
|
90735
|
90736
|
90737
|
90738
|
90739
|
90759
|
90816