diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index e31e9ee0ab..a505bf279c 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -800,6 +800,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 library_closure_exceptions + +Type: has_many + +Related object: L + +=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 + +=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 + +=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 + +=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 - -=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 - -=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 diff --git a/Koha/Schema/Result/LibraryClosureException.pm b/Koha/Schema/Result/LibraryClosureException.pm new file mode 100644 index 0000000000..d2ed742b2f --- /dev/null +++ b/Koha/Schema/Result/LibraryClosureException.pm @@ -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 + +=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 + +=back + +=cut + +__PACKAGE__->set_primary_key("library_closure_exception_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("library_id_date", ["library_id", "date"]); + +=head1 RELATIONS + +=head2 library + +Type: belongs_to + +Related object: L + +=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; diff --git a/Koha/Schema/Result/RepeatableHoliday.pm b/Koha/Schema/Result/LibraryRepeatingClosure.pm similarity index 56% rename from Koha/Schema/Result/RepeatableHoliday.pm rename to Koha/Schema/Result/LibraryRepeatingClosure.pm index 882f063bc1..de66f55096 100644 --- a/Koha/Schema/Result/RepeatableHoliday.pm +++ b/Koha/Schema/Result/LibraryRepeatingClosure.pm @@ -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 +=head1 TABLE: C =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 +=item * L =back =cut -__PACKAGE__->set_primary_key("id"); +__PACKAGE__->set_primary_key("library_repeating_closure_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=item * L + +=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 =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; diff --git a/Koha/Schema/Result/LibrarySingleClosure.pm b/Koha/Schema/Result/LibrarySingleClosure.pm new file mode 100644 index 0000000000..e440752090 --- /dev/null +++ b/Koha/Schema/Result/LibrarySingleClosure.pm @@ -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 + +=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 + +=back + +=cut + +__PACKAGE__->set_primary_key("library_single_closure_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("library_id_date", ["library_id", "date"]); + +=head1 RELATIONS + +=head2 library + +Type: belongs_to + +Related object: L + +=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; diff --git a/Koha/Schema/Result/LibraryWeeklyClosure.pm b/Koha/Schema/Result/LibraryWeeklyClosure.pm new file mode 100644 index 0000000000..1df5cebfee --- /dev/null +++ b/Koha/Schema/Result/LibraryWeeklyClosure.pm @@ -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 + +=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 + +=back + +=cut + +__PACKAGE__->set_primary_key("library_weekly_closure_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("library_id_weekday", ["library_id", "weekday"]); + +=head1 RELATIONS + +=head2 library + +Type: belongs_to + +Related object: L + +=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; diff --git a/Koha/Schema/Result/SpecialHoliday.pm b/Koha/Schema/Result/SpecialHoliday.pm deleted file mode 100644 index a52248f53a..0000000000 --- a/Koha/Schema/Result/SpecialHoliday.pm +++ /dev/null @@ -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 - -=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 - -=back - -=cut - -__PACKAGE__->set_primary_key("id"); - -=head1 RELATIONS - -=head2 branchcode - -Type: belongs_to - -Related object: L - -=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;