Bugzilla – Attachment 82119 Details for
Bug 15836
Labels: Offer configuration option for splitting call numbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15836: DBIC Schema change
Bug-15836-DBIC-Schema-change.patch (text/plain), 4.16 KB, created by
Katrin Fischer
on 2018-11-08 20:54:29 UTC
(
hide
)
Description:
Bug 15836: DBIC Schema change
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-11-08 20:54:29 UTC
Size:
4.16 KB
patch
obsolete
>From 9206ed23af31654d35b5b38c230c2c766f060eda Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Nov 2018 16:33:56 -0300 >Subject: [PATCH] Bug 15836: DBIC Schema change > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Schema/Result/ClassSource.pm | 35 +++++++++++- > Koha/Schema/Result/ClassSplitRule.pm | 100 +++++++++++++++++++++++++++++++++++ > 2 files changed, 133 insertions(+), 2 deletions(-) > create mode 100644 Koha/Schema/Result/ClassSplitRule.pm > >diff --git a/Koha/Schema/Result/ClassSource.pm b/Koha/Schema/Result/ClassSource.pm >index 6c7a4413d5..c64d03ccc8 100644 >--- a/Koha/Schema/Result/ClassSource.pm >+++ b/Koha/Schema/Result/ClassSource.pm >@@ -49,6 +49,14 @@ __PACKAGE__->table("class_sources"); > is_nullable: 0 > size: 10 > >+=head2 class_split_rule >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_foreign_key: 1 >+ is_nullable: 0 >+ size: 10 >+ > =cut > > __PACKAGE__->add_columns( >@@ -66,6 +74,14 @@ __PACKAGE__->add_columns( > is_nullable => 0, > size => 10, > }, >+ "class_split_rule", >+ { >+ data_type => "varchar", >+ default_value => "", >+ is_foreign_key => 1, >+ is_nullable => 0, >+ size => 10, >+ }, > ); > > =head1 PRIMARY KEY >@@ -97,9 +113,24 @@ __PACKAGE__->belongs_to( > { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, > ); > >+=head2 class_split_rule >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::ClassSplitRule> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "class_split_rule", >+ "Koha::Schema::Result::ClassSplitRule", >+ { class_split_rule => "class_split_rule" }, >+ { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, >+); >+ > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tu9NZrk0s8VBgtc1kNpXgg >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-11-08 16:33:27 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fB+fYXMevzvwogIhmVAlgA > > > # You can replace this text with custom content, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/ClassSplitRule.pm b/Koha/Schema/Result/ClassSplitRule.pm >new file mode 100644 >index 0000000000..59fa6988b9 >--- /dev/null >+++ b/Koha/Schema/Result/ClassSplitRule.pm >@@ -0,0 +1,100 @@ >+use utf8; >+package Koha::Schema::Result::ClassSplitRule; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::ClassSplitRule >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<class_split_rules> >+ >+=cut >+ >+__PACKAGE__->table("class_split_rules"); >+ >+=head1 ACCESSORS >+ >+=head2 class_split_rule >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 10 >+ >+=head2 description >+ >+ data_type: 'longtext' >+ is_nullable: 1 >+ >+=head2 split_routine >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 30 >+ >+=head2 split_regex >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 255 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "class_split_rule", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, >+ "description", >+ { data_type => "longtext", is_nullable => 1 }, >+ "split_routine", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 30 }, >+ "split_regex", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</class_split_rule> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("class_split_rule"); >+ >+=head1 RELATIONS >+ >+=head2 class_sources >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::ClassSource> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "class_sources", >+ "Koha::Schema::Result::ClassSource", >+ { "foreign.class_split_rule" => "self.class_split_rule" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-11-08 14:29:56 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nsH0stuc8YqVuaea2MDOfg >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >-- >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 15836
:
76691
|
76692
|
76693
|
76694
|
76695
|
76696
|
77061
|
77079
|
77306
|
78791
|
78793
|
78795
|
78796
|
78798
|
78799
|
79029
|
80339
|
80340
|
80341
|
80342
|
80343
|
80344
|
80345
|
80346
|
80347
|
80548
|
80549
|
80550
|
80551
|
80552
|
80553
|
80554
|
80555
|
80556
|
81033
|
81034
|
81035
|
81036
|
81037
|
81038
|
81039
|
81040
|
81041
|
81627
|
81628
|
81629
|
81630
|
81631
|
81632
|
81633
|
81634
|
81635
|
82110
|
82112
|
82113
|
82118
|
82119
|
82120
|
82289
|
82290
|
82291
|
82292
|
82293
|
82294
|
82295
|
82296
|
82297
|
82298
|
82299
|
82300
|
82301
|
82302
|
82317
|
82318
|
82319
|
82321