Bug 42310: DBIC schema update

Regenerated via dbic --force after the library_weekly_closures,
library_repeating_closures, library_single_closures, and
library_closure_exceptions tables replaced repeatable_holidays and
special_holidays.

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-08-05 08:58:38 +01:00 committed by Pedro Amorim
parent ca487a18e0
commit c0349ad142
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
6 changed files with 491 additions and 209 deletions

View File

@ -800,6 +800,21 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 library_closure_exceptions
Type: has_many
Related object: L<Koha::Schema::Result::LibraryClosureException>
=cut
__PACKAGE__->has_many(
"library_closure_exceptions",
"Koha::Schema::Result::LibraryClosureException",
{ "foreign.library_id" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 library_float_limits
Type: has_many
@ -845,6 +860,36 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 library_repeating_closures
Type: has_many
Related object: L<Koha::Schema::Result::LibraryRepeatingClosure>
=cut
__PACKAGE__->has_many(
"library_repeating_closures",
"Koha::Schema::Result::LibraryRepeatingClosure",
{ "foreign.library_id" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 library_single_closures
Type: has_many
Related object: L<Koha::Schema::Result::LibrarySingleClosure>
=cut
__PACKAGE__->has_many(
"library_single_closures",
"Koha::Schema::Result::LibrarySingleClosure",
{ "foreign.library_id" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 library_smtp_server
Type: might_have
@ -860,6 +905,21 @@ __PACKAGE__->might_have(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 library_weekly_closures
Type: has_many
Related object: L<Koha::Schema::Result::LibraryWeeklyClosure>
=cut
__PACKAGE__->has_many(
"library_weekly_closures",
"Koha::Schema::Result::LibraryWeeklyClosure",
{ "foreign.library_id" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 old_reserves
Type: has_many
@ -905,21 +965,6 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 repeatable_holidays
Type: has_many
Related object: L<Koha::Schema::Result::RepeatableHoliday>
=cut
__PACKAGE__->has_many(
"repeatable_holidays",
"Koha::Schema::Result::RepeatableHoliday",
{ "foreign.branchcode" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 reports_branches
Type: has_many
@ -950,21 +995,6 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 special_holidays
Type: has_many
Related object: L<Koha::Schema::Result::SpecialHoliday>
=cut
__PACKAGE__->has_many(
"special_holidays",
"Koha::Schema::Result::SpecialHoliday",
{ "foreign.branchcode" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 stockrotationstages
Type: has_many

View File

@ -0,0 +1,131 @@
use utf8;
package Koha::Schema::Result::LibraryClosureException;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::LibraryClosureException
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<library_closure_exceptions>
=cut
__PACKAGE__->table("library_closure_exceptions");
=head1 ACCESSORS
=head2 library_closure_exception_id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
unique identifier
=head2 library_id
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
foreign key from the branches table
=head2 date
data_type: 'date'
datetime_undef_if_invalid: 1
is_nullable: 0
date of the exception (library is open despite a closure rule)
=head2 title
data_type: 'varchar'
default_value: (empty string)
is_nullable: 0
size: 50
title for this exception
=head2 description
data_type: 'mediumtext'
is_nullable: 0
description of this exception
=cut
__PACKAGE__->add_columns(
"library_closure_exception_id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"library_id",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"date",
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
"title",
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
"description",
{ data_type => "mediumtext", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</library_closure_exception_id>
=back
=cut
__PACKAGE__->set_primary_key("library_closure_exception_id");
=head1 UNIQUE CONSTRAINTS
=head2 C<library_id_date>
=over 4
=item * L</library_id>
=item * L</date>
=back
=cut
__PACKAGE__->add_unique_constraint("library_id_date", ["library_id", "date"]);
=head1 RELATIONS
=head2 library
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"library",
"Koha::Schema::Result::Branch",
{ branchcode => "library_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07053 @ 2026-04-08 18:44:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Yocq8npRLy1r8xhR65EBfQ
1;

View File

@ -1,12 +1,12 @@
use utf8;
package Koha::Schema::Result::RepeatableHoliday;
package Koha::Schema::Result::LibraryRepeatingClosure;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::RepeatableHoliday
Koha::Schema::Result::LibraryRepeatingClosure
=cut
@ -15,49 +15,42 @@ use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<repeatable_holidays>
=head1 TABLE: C<library_repeating_closures>
=cut
__PACKAGE__->table("repeatable_holidays");
__PACKAGE__->table("library_repeating_closures");
=head1 ACCESSORS
=head2 id
=head2 library_repeating_closure_id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
unique identifier assigned by Koha
unique identifier
=head2 branchcode
=head2 library_id
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
foreign key from the branches table, defines which branch this closing is for
=head2 weekday
data_type: 'smallint'
is_nullable: 1
day of the week (0=Sunday, 1=Monday, etc) this closing is repeated on
foreign key from the branches table
=head2 day
data_type: 'smallint'
is_nullable: 1
is_nullable: 0
day of the month this closing is on
=head2 month
data_type: 'smallint'
is_nullable: 1
is_nullable: 0
month this closing is in
@ -80,16 +73,14 @@ description for this closing
=cut
__PACKAGE__->add_columns(
"id",
"library_repeating_closure_id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"branchcode",
"library_id",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"weekday",
{ data_type => "smallint", is_nullable => 1 },
"day",
{ data_type => "smallint", is_nullable => 1 },
{ data_type => "smallint", is_nullable => 0 },
"month",
{ data_type => "smallint", is_nullable => 1 },
{ data_type => "smallint", is_nullable => 0 },
"title",
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
"description",
@ -100,17 +91,35 @@ __PACKAGE__->add_columns(
=over 4
=item * L</id>
=item * L</library_repeating_closure_id>
=back
=cut
__PACKAGE__->set_primary_key("id");
__PACKAGE__->set_primary_key("library_repeating_closure_id");
=head1 UNIQUE CONSTRAINTS
=head2 C<library_id_day_month>
=over 4
=item * L</library_id>
=item * L</day>
=item * L</month>
=back
=cut
__PACKAGE__->add_unique_constraint("library_id_day_month", ["library_id", "day", "month"]);
=head1 RELATIONS
=head2 branchcode
=head2 library
Type: belongs_to
@ -119,16 +128,14 @@ Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"branchcode",
"library",
"Koha::Schema::Result::Branch",
{ branchcode => "branchcode" },
{ branchcode => "library_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OZykv+F1kgqeLvezCyhvZA
# Created by DBIx::Class::Schema::Loader v0.07053 @ 2026-04-08 18:44:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NC9XLjyjtiR2CsDPP41S3g
# You can replace this text with custom content, and it will be preserved on regeneration
1;

View File

@ -0,0 +1,131 @@
use utf8;
package Koha::Schema::Result::LibrarySingleClosure;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::LibrarySingleClosure
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<library_single_closures>
=cut
__PACKAGE__->table("library_single_closures");
=head1 ACCESSORS
=head2 library_single_closure_id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
unique identifier
=head2 library_id
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
foreign key from the branches table
=head2 date
data_type: 'date'
datetime_undef_if_invalid: 1
is_nullable: 0
date of the closure
=head2 title
data_type: 'varchar'
default_value: (empty string)
is_nullable: 0
size: 50
title for this closing
=head2 description
data_type: 'mediumtext'
is_nullable: 0
description of this closing
=cut
__PACKAGE__->add_columns(
"library_single_closure_id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"library_id",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"date",
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
"title",
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
"description",
{ data_type => "mediumtext", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</library_single_closure_id>
=back
=cut
__PACKAGE__->set_primary_key("library_single_closure_id");
=head1 UNIQUE CONSTRAINTS
=head2 C<library_id_date>
=over 4
=item * L</library_id>
=item * L</date>
=back
=cut
__PACKAGE__->add_unique_constraint("library_id_date", ["library_id", "date"]);
=head1 RELATIONS
=head2 library
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"library",
"Koha::Schema::Result::Branch",
{ branchcode => "library_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07053 @ 2026-04-08 18:44:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:98ikVfQC+ja7Yr4Oby85pA
1;

View File

@ -0,0 +1,130 @@
use utf8;
package Koha::Schema::Result::LibraryWeeklyClosure;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::LibraryWeeklyClosure
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<library_weekly_closures>
=cut
__PACKAGE__->table("library_weekly_closures");
=head1 ACCESSORS
=head2 library_weekly_closure_id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
unique identifier
=head2 library_id
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
foreign key from the branches table
=head2 weekday
data_type: 'smallint'
is_nullable: 0
day of the week (0=Sunday, 1=Monday, etc)
=head2 title
data_type: 'varchar'
default_value: (empty string)
is_nullable: 0
size: 50
title of this closing
=head2 description
data_type: 'mediumtext'
is_nullable: 0
description for this closing
=cut
__PACKAGE__->add_columns(
"library_weekly_closure_id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"library_id",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"weekday",
{ data_type => "smallint", is_nullable => 0 },
"title",
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
"description",
{ data_type => "mediumtext", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</library_weekly_closure_id>
=back
=cut
__PACKAGE__->set_primary_key("library_weekly_closure_id");
=head1 UNIQUE CONSTRAINTS
=head2 C<library_id_weekday>
=over 4
=item * L</library_id>
=item * L</weekday>
=back
=cut
__PACKAGE__->add_unique_constraint("library_id_weekday", ["library_id", "weekday"]);
=head1 RELATIONS
=head2 library
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"library",
"Koha::Schema::Result::Branch",
{ branchcode => "library_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07053 @ 2026-04-08 18:44:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2DqS0FAKqaZrpqCNlJNYaw
1;

View File

@ -1,147 +0,0 @@
use utf8;
package Koha::Schema::Result::SpecialHoliday;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::SpecialHoliday
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<special_holidays>
=cut
__PACKAGE__->table("special_holidays");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
unique identifier assigned by Koha
=head2 branchcode
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
foreign key from the branches table, defines which branch this closing is for
=head2 day
data_type: 'smallint'
default_value: 0
is_nullable: 0
day of the month this closing is on
=head2 month
data_type: 'smallint'
default_value: 0
is_nullable: 0
month this closing is in
=head2 year
data_type: 'smallint'
default_value: 0
is_nullable: 0
year this closing is in
=head2 isexception
data_type: 'smallint'
default_value: 1
is_nullable: 0
is this a holiday exception to a repeatable holiday (1 for yes, 0 for no)
=head2 title
data_type: 'varchar'
default_value: (empty string)
is_nullable: 0
size: 50
title for this closing
=head2 description
data_type: 'mediumtext'
is_nullable: 0
description of this closing
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"branchcode",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"day",
{ data_type => "smallint", default_value => 0, is_nullable => 0 },
"month",
{ data_type => "smallint", default_value => 0, is_nullable => 0 },
"year",
{ data_type => "smallint", default_value => 0, is_nullable => 0 },
"isexception",
{ data_type => "smallint", default_value => 1, is_nullable => 0 },
"title",
{ data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
"description",
{ data_type => "mediumtext", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
=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, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H3PUa5HiJKKfdndKXbmJ6A
# You can replace this text with custom content, and it will be preserved on regeneration
1;