From 62a322f7976312886cbd57d75c4fbfeccdbf86c8 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 2 May 2024 11:39:50 +0000 Subject: [PATCH] Bug 35657: DBIC schema update Signed-off-by: Katrin Fischer --- Koha/Schema/Result/Borrower.pm | 34 ++++++++++++++++++++++++++++-- Koha/Schema/Result/Ticket.pm | 34 ++++++++++++++++++++++++++++-- Koha/Schema/Result/TicketUpdate.pm | 34 ++++++++++++++++++++++++++++-- 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 3657c03c32..bf8ba36030 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -2002,6 +2002,36 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 ticket_updates_assignees + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "ticket_updates_assignees", + "Koha::Schema::Result::TicketUpdate", + { "foreign.assignee_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 tickets_assignees + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "tickets_assignees", + "Koha::Schema::Result::Ticket", + { "foreign.assignee_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 tickets_reporters Type: has_many @@ -2158,8 +2188,8 @@ Composing rels: L -> permission __PACKAGE__->many_to_many("permissions", "user_permissions", "permission"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-11-03 14:18:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PcGXqEI1ULB+Uoclqfbxig +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-02 11:36:36 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jUOMoSonNmA3KwtZKVxqOA __PACKAGE__->has_many( "restrictions", diff --git a/Koha/Schema/Result/Ticket.pm b/Koha/Schema/Result/Ticket.pm index 949d1d0888..abc639a055 100644 --- a/Koha/Schema/Result/Ticket.pm +++ b/Koha/Schema/Result/Ticket.pm @@ -80,6 +80,14 @@ ticket details current status of the ticket +=head2 assignee_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +id of the user who this ticket is assigned to + =head2 resolver_id data_type: 'integer' @@ -136,6 +144,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "status", { data_type => "varchar", is_nullable => 1, size => 80 }, + "assignee_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "resolver_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "resolved_date", @@ -162,6 +172,26 @@ __PACKAGE__->set_primary_key("id"); =head1 RELATIONS +=head2 assignee + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "assignee", + "Koha::Schema::Result::Borrower", + { borrowernumber => "assignee_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 biblio Type: belongs_to @@ -233,8 +263,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-04-30 09:10:16 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j1Ey1v55g3qw7ws03w7isQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-02 11:36:36 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8bWiSb7hXPFYRzRzrVG3kw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/TicketUpdate.pm b/Koha/Schema/Result/TicketUpdate.pm index d987e6a628..06851ec9b6 100644 --- a/Koha/Schema/Result/TicketUpdate.pm +++ b/Koha/Schema/Result/TicketUpdate.pm @@ -48,6 +48,14 @@ id of catalog ticket the update relates to id of the user who logged the update +=head2 assignee_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +id of the user who this ticket was assigned to at this update + =head2 public data_type: 'tinyint' @@ -94,6 +102,8 @@ __PACKAGE__->add_columns( is_foreign_key => 1, is_nullable => 0, }, + "assignee_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "public", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "date", @@ -123,6 +133,26 @@ __PACKAGE__->set_primary_key("id"); =head1 RELATIONS +=head2 assignee + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "assignee", + "Koha::Schema::Result::Borrower", + { borrowernumber => "assignee_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 ticket Type: belongs_to @@ -154,8 +184,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-04-30 09:10:16 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ytO0skgfeeAKxubBk+4wtw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-02 11:36:36 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yfQ97AZ3ZYRI5uUndgLKMA __PACKAGE__->add_columns( '+public' => { is_boolean => 1 }, ); -- 2.39.2