From 2a698d15cdbf831d55ca6193c12c524a12ef3d07 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 24 Feb 2022 14:34:30 -1000 Subject: [PATCH] Bug 30060: Update DBIC Schema Signed-off-by: Fridolin Somers --- 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 20ea7e30fb..5d43423cb8 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 @ 2022-02-25 00:33:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qPGKczsaKaLxxiNzZS5zdQ __PACKAGE__->has_many( "extended_attributes", diff --git a/Koha/Schema/Result/Permission.pm b/Koha/Schema/Result/Permission.pm index e2444ee0ad..b238c2733e 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 @ 2022-02-25 00:33:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L0ySPlaEt7Ax62xqBMIZpQ # 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..22422684e2 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 @ 2022-02-25 00:33:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sp3t39eo8WmHNKGljRXyEw # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5