Bug 30719: DBIC schema

Signed-off-by: Edith Speller <Edith.Speller@ukhsa.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2023-05-12 17:11:24 +00:00
parent 4a694c4fb5
commit 45d369aa81
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
5 changed files with 383 additions and 6 deletions

View File

@ -1402,6 +1402,21 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 illbatches
Type: has_many
Related object: L<Koha::Schema::Result::Illbatch>
=cut
__PACKAGE__->has_many(
"illbatches",
"Koha::Schema::Result::Illbatch",
{ "foreign.borrowernumber" => "self.borrowernumber" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 illcomments
Type: has_many
@ -2103,8 +2118,8 @@ Composing rels: L</user_permissions> -> permission
__PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-06 15:46:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f6omVb7EtiysdaWTX3IRzg
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-28 11:24:21
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RUWvcq9kgQvACo14H/u9jQ
__PACKAGE__->has_many(
"restrictions",

View File

@ -692,6 +692,21 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 illbatches
Type: has_many
Related object: L<Koha::Schema::Result::Illbatch>
=cut
__PACKAGE__->has_many(
"illbatches",
"Koha::Schema::Result::Illbatch",
{ "foreign.branchcode" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 illrequests
Type: has_many
@ -918,8 +933,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-08 17:35:26
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QPqXuEigMeIBb9NKMSkrNw
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-04-28 11:24:21
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GGYhqyTVMmaFo9hAY4Jy5w
__PACKAGE__->add_columns(
'+pickup_location' => { is_boolean => 1 },

View File

@ -0,0 +1,200 @@
use utf8;
package Koha::Schema::Result::Illbatch;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::Illbatch
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<illbatches>
=cut
__PACKAGE__->table("illbatches");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
Batch ID
=head2 name
data_type: 'varchar'
is_nullable: 0
size: 100
Unique name of batch
=head2 backend
data_type: 'varchar'
is_nullable: 0
size: 20
Name of batch backend
=head2 borrowernumber
data_type: 'integer'
is_foreign_key: 1
is_nullable: 1
Patron associated with batch
=head2 branchcode
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 1
size: 50
Branch associated with batch
=head2 statuscode
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 1
size: 20
Status of batch
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 100 },
"backend",
{ data_type => "varchar", is_nullable => 0, size => 20 },
"borrowernumber",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"branchcode",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 50 },
"statuscode",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 20 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 UNIQUE CONSTRAINTS
=head2 C<u_illbatches__name>
=over 4
=item * L</name>
=back
=cut
__PACKAGE__->add_unique_constraint("u_illbatches__name", ["name"]);
=head1 RELATIONS
=head2 borrowernumber
Type: belongs_to
Related object: L<Koha::Schema::Result::Borrower>
=cut
__PACKAGE__->belongs_to(
"borrowernumber",
"Koha::Schema::Result::Borrower",
{ borrowernumber => "borrowernumber" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
=head2 branchcode
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"branchcode",
"Koha::Schema::Result::Branch",
{ branchcode => "branchcode" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
=head2 illrequests
Type: has_many
Related object: L<Koha::Schema::Result::Illrequest>
=cut
__PACKAGE__->has_many(
"illrequests",
"Koha::Schema::Result::Illrequest",
{ "foreign.batch_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 statuscode
Type: belongs_to
Related object: L<Koha::Schema::Result::IllbatchStatus>
=cut
__PACKAGE__->belongs_to(
"statuscode",
"Koha::Schema::Result::IllbatchStatus",
{ code => "statuscode" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-09-08 13:49:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YKxQxJMKxdBP9X4+i0Rfzw
1;

View File

@ -0,0 +1,117 @@
use utf8;
package Koha::Schema::Result::IllbatchStatus;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::IllbatchStatus
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<illbatch_statuses>
=cut
__PACKAGE__->table("illbatch_statuses");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
Status ID
=head2 name
data_type: 'varchar'
is_nullable: 0
size: 100
Name of status
=head2 code
data_type: 'varchar'
is_nullable: 0
size: 20
Unique, immutable code for status
=head2 is_system
data_type: 'tinyint'
is_nullable: 1
Is this status required for system operation
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 100 },
"code",
{ data_type => "varchar", is_nullable => 0, size => 20 },
"is_system",
{ data_type => "tinyint", is_nullable => 1 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 UNIQUE CONSTRAINTS
=head2 C<u_illbatchstatuses__code>
=over 4
=item * L</code>
=back
=cut
__PACKAGE__->add_unique_constraint("u_illbatchstatuses__code", ["code"]);
=head1 RELATIONS
=head2 illbatches
Type: has_many
Related object: L<Koha::Schema::Result::Illbatch>
=cut
__PACKAGE__->has_many(
"illbatches",
"Koha::Schema::Result::Illbatch",
{ "foreign.statuscode" => "self.code" },
{ cascade_copy => 0, cascade_delete => 0 },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-09-08 13:49:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yo60FJ+kyRj8QuEMac8CFA
1;

View File

@ -182,6 +182,14 @@ Backend id attached to request
The backend used to create request
=head2 batch_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 1
Optional ID of batch that this request belongs to
=cut
__PACKAGE__->add_columns(
@ -239,6 +247,8 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 1, size => 50 },
"backend",
{ data_type => "varchar", is_nullable => 1, size => 20 },
"batch_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
);
=head1 PRIMARY KEY
@ -255,6 +265,26 @@ __PACKAGE__->set_primary_key("illrequest_id");
=head1 RELATIONS
=head2 batch
Type: belongs_to
Related object: L<Koha::Schema::Result::Illbatch>
=cut
__PACKAGE__->belongs_to(
"batch",
"Koha::Schema::Result::Illbatch",
{ id => "batch_id" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
=head2 biblio
Type: belongs_to
@ -361,8 +391,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-06-05 16:11:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6b58Mo/KzvheZCurYvKu7A
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-09-08 13:51:09
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QS3E1jO/d797B0ADcjT0yQ
__PACKAGE__->has_many(
"comments",