From eac8a249c07a1afa6650bac4f02cc5ac00248097 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Sun, 22 Feb 2026 20:17:53 +0000 Subject: [PATCH] Bug 39224: DBIC Schema customisations Adds customisations below the auto-generated hash line in the DBIx::Class Result classes: - Boolean column overrides (is_boolean => 1) for flag columns - koha_object_class / koha_objects_class declarations linking schema to Koha object classes - Custom relationships (e.g. hostnames on IdentityProvider) Sponsored-by: ByWater Solutions --- Koha/Schema/Result/Hostname.pm | 16 +++++++++++++ Koha/Schema/Result/IdentityProvider.pm | 18 +++++++++++++++ Koha/Schema/Result/IdentityProviderDomain.pm | 3 ++- .../Schema/Result/IdentityProviderHostname.pm | 23 +++++++++++++++++++ Koha/Schema/Result/IdentityProviderMapping.pm | 22 ++++++++++++++++++ 5 files changed, 81 insertions(+), 1 deletion(-) diff --git a/Koha/Schema/Result/Hostname.pm b/Koha/Schema/Result/Hostname.pm index 660973c8848..3d04927a203 100644 --- a/Koha/Schema/Result/Hostname.pm +++ b/Koha/Schema/Result/Hostname.pm @@ -95,4 +95,20 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-20 10:20:26 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uvzH69NxZ1akNcfsvgRDIg +=head2 koha_object_class + +Missing POD for koha_object_class. + +=cut + +sub koha_object_class { 'Koha::Auth::Hostname' } + +=head2 koha_objects_class + +Missing POD for koha_objects_class. + +=cut + +sub koha_objects_class { 'Koha::Auth::Hostnames' } + 1; diff --git a/Koha/Schema/Result/IdentityProvider.pm b/Koha/Schema/Result/IdentityProvider.pm index 5c05f3d9cea..82e0841e7d5 100644 --- a/Koha/Schema/Result/IdentityProvider.pm +++ b/Koha/Schema/Result/IdentityProvider.pm @@ -178,6 +178,10 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-21 07:16:46 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4T1F2ggwQdvVV7jskMZwig +__PACKAGE__->add_columns( + '+enabled' => { is_boolean => 1 }, +); + __PACKAGE__->has_many( "domains", "Koha::Schema::Result::IdentityProviderDomain", @@ -185,6 +189,20 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->has_many( + "hostnames", + "Koha::Schema::Result::IdentityProviderHostname", + { "foreign.identity_provider_id" => "self.identity_provider_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->has_many( + "mappings", + "Koha::Schema::Result::IdentityProviderMapping", + { "foreign.identity_provider_id" => "self.identity_provider_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 koha_object_class Missing POD for koha_object_class. diff --git a/Koha/Schema/Result/IdentityProviderDomain.pm b/Koha/Schema/Result/IdentityProviderDomain.pm index 9a0af083e8c..5d5d4bfdeee 100644 --- a/Koha/Schema/Result/IdentityProviderDomain.pm +++ b/Koha/Schema/Result/IdentityProviderDomain.pm @@ -234,7 +234,8 @@ __PACKAGE__->add_columns( '+auto_register_staff' => { is_boolean => 1 }, '+update_on_auth' => { is_boolean => 1 }, '+allow_opac' => { is_boolean => 1 }, - '+allow_staff' => { is_boolean => 1 } + '+allow_staff' => { is_boolean => 1 }, + '+send_welcome_email' => { is_boolean => 1 }, ); =head2 koha_object_class diff --git a/Koha/Schema/Result/IdentityProviderHostname.pm b/Koha/Schema/Result/IdentityProviderHostname.pm index fe2f121e12a..7ec1895095f 100644 --- a/Koha/Schema/Result/IdentityProviderHostname.pm +++ b/Koha/Schema/Result/IdentityProviderHostname.pm @@ -149,4 +149,27 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-21 07:16:46 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K31ZTdC8ZmSuuKPACLnrUQ + +__PACKAGE__->add_columns( + '+is_enabled' => { is_boolean => 1 }, + '+force_sso' => { is_boolean => 1 }, +); + +=head2 koha_object_class + +Missing POD for koha_object_class. + +=cut + + +sub koha_object_class { 'Koha::Auth::Identity::Provider::Hostname' } + +=head2 koha_objects_class + +Missing POD for koha_objects_class. + +=cut + +sub koha_objects_class { 'Koha::Auth::Identity::Provider::Hostnames' } + 1; diff --git a/Koha/Schema/Result/IdentityProviderMapping.pm b/Koha/Schema/Result/IdentityProviderMapping.pm index eb52b4bbc7f..7ed22d05e0f 100644 --- a/Koha/Schema/Result/IdentityProviderMapping.pm +++ b/Koha/Schema/Result/IdentityProviderMapping.pm @@ -137,4 +137,26 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07051 @ 2026-02-20 10:20:26 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x2JmD4As/a96Ndoe5rzuKg + +__PACKAGE__->add_columns( + '+is_matchpoint' => { is_boolean => 1 }, +); + +=head2 koha_object_class + +Missing POD for koha_object_class. + +=cut + + +sub koha_object_class { 'Koha::Auth::Identity::Provider::Mapping' } + +=head2 koha_objects_class + +Missing POD for koha_objects_class. + +=cut + +sub koha_objects_class { 'Koha::Auth::Identity::Provider::Mappings' } + 1; -- 2.53.0