Bugzilla – Attachment 55215 Details for
Bug 17216
Add a new table to store authorized value categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17216: Update DBIC Schema
Bug-17216-Update-DBIC-Schema.patch (text/plain), 3.61 KB, created by
Jonathan Druart
on 2016-09-06 07:18:45 UTC
(
hide
)
Description:
Bug 17216: Update DBIC Schema
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-06 07:18:45 UTC
Size:
3.61 KB
patch
obsolete
>From 383954237ef2c9891152e32f681d720dad1978cb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 30 Aug 2016 11:56:14 +0100 >Subject: [PATCH] Bug 17216: Update DBIC Schema > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > Koha/Schema/Result/AuthorisedValue.pm | 28 ++++++++++++++++++++++++--- > Koha/Schema/Result/AuthorisedValueCategory.pm | 24 +++++++++++++++++++---- > 2 files changed, 45 insertions(+), 7 deletions(-) > >diff --git a/Koha/Schema/Result/AuthorisedValue.pm b/Koha/Schema/Result/AuthorisedValue.pm >index d1f6af6..394844d 100644 >--- a/Koha/Schema/Result/AuthorisedValue.pm >+++ b/Koha/Schema/Result/AuthorisedValue.pm >@@ -33,6 +33,7 @@ __PACKAGE__->table("authorised_values"); > > data_type: 'varchar' > default_value: (empty string) >+ is_foreign_key: 1 > is_nullable: 0 > size: 32 > >@@ -67,7 +68,13 @@ __PACKAGE__->add_columns( > "id", > { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, > "category", >- { data_type => "varchar", default_value => "", is_nullable => 0, size => 32 }, >+ { >+ data_type => "varchar", >+ default_value => "", >+ is_foreign_key => 1, >+ is_nullable => 0, >+ size => 32, >+ }, > "authorised_value", > { data_type => "varchar", default_value => "", is_nullable => 0, size => 80 }, > "lib", >@@ -107,9 +114,24 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 category >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::AuthorisedValueCategory> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "category", >+ "Koha::Schema::Result::AuthorisedValueCategory", >+ { category_name => "category" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ > >-# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-29 11:50:45 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VtpTwYpCMG3VVmsrQspdxw >+# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-30 11:52:45 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LOArv8JQ0aiTZgcy+jb7pA > > > # You can replace this text with custom content, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/AuthorisedValueCategory.pm b/Koha/Schema/Result/AuthorisedValueCategory.pm >index c5de266..596db14 100644 >--- a/Koha/Schema/Result/AuthorisedValueCategory.pm >+++ b/Koha/Schema/Result/AuthorisedValueCategory.pm >@@ -26,14 +26,15 @@ __PACKAGE__->table("authorised_value_categories"); > =head2 category_name > > data_type: 'varchar' >+ default_value: (empty string) > is_nullable: 0 >- size: 80 >+ size: 32 > > =cut > > __PACKAGE__->add_columns( > "category_name", >- { data_type => "varchar", is_nullable => 0, size => 80 }, >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 32 }, > ); > > =head1 PRIMARY KEY >@@ -50,6 +51,21 @@ __PACKAGE__->set_primary_key("category_name"); > > =head1 RELATIONS > >+=head2 authorised_values >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::AuthorisedValue> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "authorised_values", >+ "Koha::Schema::Result::AuthorisedValue", >+ { "foreign.category" => "self.category_name" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 items_search_fields > > Type: has_many >@@ -66,8 +82,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-29 11:50:45 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fF91wGF5/xHvp8JX5fAAtw >+# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-30 11:54:19 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:T8LzWM/O8zSGpRhTZbzvJA > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >-- >2.8.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 17216
:
54979
|
54980
|
54981
|
54982
|
54983
|
54984
|
54985
|
54987
|
54988
|
54989
|
54990
|
54991
|
54992
|
54993
|
55003
|
55004
|
55005
|
55008
|
55009
|
55010
|
55011
|
55021
|
55022
|
55023
|
55024
|
55025
|
55026
|
55027
|
55028
|
55029
|
55030
|
55031
|
55032
|
55047
|
55207
|
55208
|
55209
|
55210
|
55211
|
55212
|
55213
|
55214
|
55215
|
55216
|
55217
|
55218
|
55365
|
55366
|
55367
|
55368
|
55369
|
55370
|
55371
|
55372
|
55373
|
55374
|
55375
|
55376
|
55692
|
55693
|
55835
|
55840
|
56202
|
56203
|
56204
|
56205
|
56206
|
56207
|
56208
|
56209
|
56210
|
56211
|
56212
|
56213
|
56214
|
56215
|
56216
|
56217
|
56619
|
57729