From 9712b2d5afb40a23fce04cc71dbe98fa68814136 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 27 Sep 2021 18:35:10 +0000 Subject: [PATCH] Bug 29125: DBIC updates --- Koha/Schema/Result/Borrower.pm | 14 +++++++++++-- Koha/Schema/Result/Permission.pm | 14 +++++++++++-- Koha/Schema/Result/UserPermission.pm | 31 +++++++++++++++++++--------- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index d4c13f1f3d..a50359b55b 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1904,9 +1904,19 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); +=head2 permissions -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-20 12:00:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9g9WsdsdPINi2NP4H2A+CA +Type: many_to_many + +Composing rels: L -> permission + +=cut + +__PACKAGE__->many_to_many("permissions", "user_permissions", "permission"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-27 12:29:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WFUCMh7pjbak1VwjWhut9w __PACKAGE__->add_columns( '+anonymized' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Permission.pm b/Koha/Schema/Result/Permission.pm index e2444ee0ad..b89ac40e5e 100644 --- a/Koha/Schema/Result/Permission.pm +++ b/Koha/Schema/Result/Permission.pm @@ -108,9 +108,19 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 borrowernumbers -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ut3lzlxoPPoIIwmhJViV1Q +Type: many_to_many + +Composing rels: L -> borrowernumber + +=cut + +__PACKAGE__->many_to_many("borrowernumbers", "user_permissions", "borrowernumber"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-27 12:29:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IHwqiCz51ygMJfBpoC6WoQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/UserPermission.pm b/Koha/Schema/Result/UserPermission.pm index 948c2e18a0..aa42a9ca05 100644 --- a/Koha/Schema/Result/UserPermission.pm +++ b/Koha/Schema/Result/UserPermission.pm @@ -41,7 +41,7 @@ __PACKAGE__->table("user_permissions"); data_type: 'varchar' is_foreign_key: 1 - is_nullable: 1 + is_nullable: 0 size: 64 =cut @@ -62,9 +62,25 @@ __PACKAGE__->add_columns( is_nullable => 0, }, "code", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 }, + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 64 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("borrowernumber", "module_bit", "code"); + =head1 RELATIONS =head2 borrowernumber @@ -94,17 +110,12 @@ __PACKAGE__->belongs_to( "permission", "Koha::Schema::Result::Permission", { code => "code", module_bit => "module_bit" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -# 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.07049 @ 2021-09-27 12:42:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zRwFHwJjFH30DSHuLBjwvQ # You can replace this text with custom content, and it will be preserved on regeneration -- 2.20.1