From ba093cf6b9aa695e59559568e7af5d126f6aa317 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 21 May 2018 06:17:26 +0000 Subject: [PATCH] Bug 20813 [Do Not Push]: Update Schema Files --- Koha/Schema/Result/Borrower.pm | 11 ++----- Koha/Schema/Result/Permission.pm | 62 +++++++++++++++++++++--------------- Koha/Schema/Result/SearchField.pm | 10 +++--- Koha/Schema/Result/UserPermission.pm | 28 ++++------------ 4 files changed, 49 insertions(+), 62 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index b739284068..fb5f6a6b72 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -303,11 +303,6 @@ __PACKAGE__->table("borrowers"); is_nullable: 1 size: 60 -=head2 flags - - data_type: 'integer' - is_nullable: 1 - =head2 userid data_type: 'varchar' @@ -584,8 +579,6 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 1 }, "password", { data_type => "varchar", is_nullable => 1, size => 60 }, - "flags", - { data_type => "integer", is_nullable => 1 }, "userid", { data_type => "varchar", is_nullable => 1, size => 75 }, "opacnote", @@ -1401,8 +1394,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-04-11 19:53:27 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/vLIMxDv4RcJOqKj6Mfg6w +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-21 06:16:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Nb3lLm1aLSltzLN0OJNsxw __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Permission.pm b/Koha/Schema/Result/Permission.pm index e2444ee0ad..7f655a2473 100644 --- a/Koha/Schema/Result/Permission.pm +++ b/Koha/Schema/Result/Permission.pm @@ -23,12 +23,12 @@ __PACKAGE__->table("permissions"); =head1 ACCESSORS -=head2 module_bit +=head2 parent - data_type: 'integer' - default_value: 0 + data_type: 'varchar' is_foreign_key: 1 - is_nullable: 0 + is_nullable: 1 + size: 64 =head2 code @@ -46,13 +46,8 @@ __PACKAGE__->table("permissions"); =cut __PACKAGE__->add_columns( - "module_bit", - { - data_type => "integer", - default_value => 0, - is_foreign_key => 1, - is_nullable => 0, - }, + "parent", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 }, "code", { data_type => "varchar", default_value => "", is_nullable => 0, size => 64 }, "description", @@ -63,31 +58,49 @@ __PACKAGE__->add_columns( =over 4 -=item * L - =item * L =back =cut -__PACKAGE__->set_primary_key("module_bit", "code"); +__PACKAGE__->set_primary_key("code"); =head1 RELATIONS -=head2 module_bit +=head2 parent Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( - "module_bit", - "Koha::Schema::Result::Userflag", - { bit => "module_bit" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + "parent", + "Koha::Schema::Result::Permission", + { code => "parent" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "RESTRICT", + }, +); + +=head2 permissions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "permissions", + "Koha::Schema::Result::Permission", + { "foreign.parent" => "self.code" }, + { cascade_copy => 0, cascade_delete => 0 }, ); =head2 user_permissions @@ -101,16 +114,13 @@ Related object: L __PACKAGE__->has_many( "user_permissions", "Koha::Schema::Result::UserPermission", - { - "foreign.code" => "self.code", - "foreign.module_bit" => "self.module_bit", - }, + { "foreign.code" => "self.code" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ut3lzlxoPPoIIwmhJViV1Q +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-21 06:16:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hazAo1EYPHLRItwCzwP1ww # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/SearchField.pm b/Koha/Schema/Result/SearchField.pm index 7475f53f58..1d17fa4029 100644 --- a/Koha/Schema/Result/SearchField.pm +++ b/Koha/Schema/Result/SearchField.pm @@ -48,7 +48,7 @@ the human readable name of the field, for display =head2 type data_type: 'enum' - extra: {list => ["","string","date","number","boolean","sum","isbn","stdno"]} + extra: {list => ["","string","date","number","boolean","sum"]} is_nullable: 0 what type of data this holds, relevant when storing it in the search engine @@ -65,9 +65,7 @@ __PACKAGE__->add_columns( "type", { data_type => "enum", - extra => { - list => ["", "string", "date", "number", "boolean", "sum", "isbn", "stdno"], - }, + extra => { list => ["", "string", "date", "number", "boolean", "sum"] }, is_nullable => 0, }, ); @@ -116,8 +114,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-09 12:50:58 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NDRiXH19vBOhrMoyJqVTGQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-21 06:16:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WIRbD1YaLBYK+neQqE31Pw __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map"); diff --git a/Koha/Schema/Result/UserPermission.pm b/Koha/Schema/Result/UserPermission.pm index 948c2e18a0..3d35117359 100644 --- a/Koha/Schema/Result/UserPermission.pm +++ b/Koha/Schema/Result/UserPermission.pm @@ -30,13 +30,6 @@ __PACKAGE__->table("user_permissions"); is_foreign_key: 1 is_nullable: 0 -=head2 module_bit - - data_type: 'integer' - default_value: 0 - is_foreign_key: 1 - is_nullable: 0 - =head2 code data_type: 'varchar' @@ -54,13 +47,6 @@ __PACKAGE__->add_columns( is_foreign_key => 1, is_nullable => 0, }, - "module_bit", - { - data_type => "integer", - default_value => 0, - is_foreign_key => 1, - is_nullable => 0, - }, "code", { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 }, ); @@ -82,7 +68,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -=head2 permission +=head2 code Type: belongs_to @@ -91,20 +77,20 @@ Related object: L =cut __PACKAGE__->belongs_to( - "permission", + "code", "Koha::Schema::Result::Permission", - { code => "code", module_bit => "module_bit" }, + { code => "code" }, { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "RESTRICT", + on_update => "RESTRICT", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9dMAYxSmVQ1cVKxmnMiMkg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-21 06:16:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/nqR/oeXcpZfNwY6Uk5ZrQ # You can replace this text with custom content, and it will be preserved on regeneration -- 2.15.1 (Apple Git-101)