Bugzilla – Attachment 43076 Details for
Bug 10855
Custom fields for subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10855: (RM followup) DBIx update
Bug-10855-RM-followup-DBIx-update.patch (text/plain), 5.42 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-10-02 18:25:44 UTC
(
hide
)
Description:
Bug 10855: (RM followup) DBIx update
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-10-02 18:25:44 UTC
Size:
5.42 KB
patch
obsolete
>From 3eb355e89203a17c04a7b533469ad7ae13e01908 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 2 Oct 2015 15:14:22 -0300 >Subject: [PATCH] Bug 10855: (RM followup) DBIx update > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Schema/Result/AdditionalField.pm | 134 +++++++++++++++++++++++++++++ > Koha/Schema/Result/AdditionalFieldValue.pm | 114 ++++++++++++++++++++++++ > 2 files changed, 248 insertions(+) > create mode 100644 Koha/Schema/Result/AdditionalField.pm > create mode 100644 Koha/Schema/Result/AdditionalFieldValue.pm > >diff --git a/Koha/Schema/Result/AdditionalField.pm b/Koha/Schema/Result/AdditionalField.pm >new file mode 100644 >index 0000000..6a9b1e5 >--- /dev/null >+++ b/Koha/Schema/Result/AdditionalField.pm >@@ -0,0 +1,134 @@ >+use utf8; >+package Koha::Schema::Result::AdditionalField; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::AdditionalField >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<additional_fields> >+ >+=cut >+ >+__PACKAGE__->table("additional_fields"); >+ >+=head1 ACCESSORS >+ >+=head2 id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 tablename >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 255 >+ >+=head2 name >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 255 >+ >+=head2 authorised_value_category >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 16 >+ >+=head2 marcfield >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 16 >+ >+=head2 searchable >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "tablename", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, >+ "name", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, >+ "authorised_value_category", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 16 }, >+ "marcfield", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 16 }, >+ "searchable", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<fields_uniq> >+ >+=over 4 >+ >+=item * L</tablename> >+ >+=item * L</name> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("fields_uniq", ["tablename", "name"]); >+ >+=head1 RELATIONS >+ >+=head2 additional_field_values >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::AdditionalFieldValue> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "additional_field_values", >+ "Koha::Schema::Result::AdditionalFieldValue", >+ { "foreign.field_id" => "self.id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-10-02 15:12:02 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vvz9GJNkU4K7bftDNuRHVA >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/AdditionalFieldValue.pm b/Koha/Schema/Result/AdditionalFieldValue.pm >new file mode 100644 >index 0000000..9dd368d >--- /dev/null >+++ b/Koha/Schema/Result/AdditionalFieldValue.pm >@@ -0,0 +1,114 @@ >+use utf8; >+package Koha::Schema::Result::AdditionalFieldValue; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::AdditionalFieldValue >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<additional_field_values> >+ >+=cut >+ >+__PACKAGE__->table("additional_field_values"); >+ >+=head1 ACCESSORS >+ >+=head2 id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 field_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+=head2 record_id >+ >+ data_type: 'integer' >+ is_nullable: 0 >+ >+=head2 value >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 255 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "field_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+ "record_id", >+ { data_type => "integer", is_nullable => 0 }, >+ "value", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<field_record> >+ >+=over 4 >+ >+=item * L</field_id> >+ >+=item * L</record_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("field_record", ["field_id", "record_id"]); >+ >+=head1 RELATIONS >+ >+=head2 field >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::AdditionalField> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "field", >+ "Koha::Schema::Result::AdditionalField", >+ { id => "field_id" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-10-02 15:12:02 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a9G6nhDU9dBDcRRN0vzkLA >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >-- >2.6.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 10855
:
20937
|
20938
|
20939
|
20940
|
20941
|
20942
|
20943
|
20944
|
21184
|
21185
|
21186
|
21187
|
21188
|
21189
|
21190
|
21191
|
21663
|
22049
|
22050
|
22051
|
22052
|
22053
|
22054
|
22055
|
22056
|
22057
|
22359
|
22360
|
22600
|
22601
|
22602
|
22603
|
22604
|
22605
|
22606
|
22607
|
22608
|
22616
|
22698
|
22699
|
22700
|
22701
|
22702
|
22703
|
22722
|
22768
|
22769
|
22869
|
23052
|
23053
|
23142
|
23143
|
23301
|
23302
|
23594
|
23595
|
23596
|
23597
|
23598
|
23599
|
23600
|
23601
|
23602
|
23774
|
23775
|
23961
|
23962
|
23963
|
23964
|
24452
|
24453
|
24454
|
24455
|
24456
|
24457
|
24569
|
24570
|
26091
|
26092
|
26093
|
26094
|
26095
|
26096
|
26097
|
26254
|
26255
|
26256
|
26257
|
26258
|
26259
|
26260
|
26276
|
26651
|
26655
|
28929
|
28930
|
28931
|
28932
|
28933
|
28934
|
28935
|
28936
|
28937
|
28938
|
28939
|
28940
|
28941
|
29095
|
29161
|
35211
|
35212
|
35213
|
35214
|
35215
|
35216
|
35217
|
35218
|
35219
|
35220
|
35221
|
35309
|
35310
|
35369
|
35556
|
36359
|
36362
|
36363
|
36364
|
36365
|
36366
|
36367
|
36368
|
36369
|
36370
|
36371
|
36372
|
36373
|
36374
|
38549
|
38550
|
38551
|
38552
|
38553
|
38554
|
38555
|
38556
|
38557
|
38558
|
38559
|
38560
|
38561
|
42296
|
42297
|
42298
|
42299
|
42300
|
42301
|
42302
|
42303
|
42304
|
42305
|
42306
|
42307
|
42308
|
42309
|
42310
|
42332
|
42333
| 43076