From 0e8a34a0d22b16be008c797aa993a4ddec28a74c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 8 Apr 2019 12:15:23 +0100 Subject: [PATCH] Bug 15326: Schema changes --- Koha/Schema/Result/Branch.pm | 17 ++++ Koha/Schema/Result/CmsPage.pm | 150 ++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 Koha/Schema/Result/CmsPage.pm diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 40d54c0f09..c91cb2e717 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -436,6 +436,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 cms_pages + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "cms_pages", + "Koha::Schema::Result::CmsPage", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 collections Type: has_many @@ -680,6 +695,8 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-11 12:56:41 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pKohWwsuUHcZSlGDj7zmcw +# You can replace this text with custom code or comments, and it will be preserved on regeneration + __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 } ); diff --git a/Koha/Schema/Result/CmsPage.pm b/Koha/Schema/Result/CmsPage.pm new file mode 100644 index 0000000000..1136c1def8 --- /dev/null +++ b/Koha/Schema/Result/CmsPage.pm @@ -0,0 +1,150 @@ +use utf8; +package Koha::Schema::Result::CmsPage; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::CmsPage + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("cms_pages"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 parent + + data_type: 'integer' + is_nullable: 1 + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +=head2 lang + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 25 + +=head2 title + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 title_link + + data_type: 'varchar' + is_nullable: 1 + size: 64 + +=head2 sortorder + + data_type: 'integer' + default_value: 0 + is_nullable: 0 + +=head2 location + + data_type: 'tinyint' + is_nullable: 1 + +=head2 publish + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 content + + data_type: 'text' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "parent", + { data_type => "integer", is_nullable => 1 }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "lang", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 25 }, + "title", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "title_link", + { data_type => "varchar", is_nullable => 1, size => 64 }, + "sortorder", + { data_type => "integer", default_value => 0, is_nullable => 0 }, + "location", + { data_type => "tinyint", is_nullable => 1 }, + "publish", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "content", + { data_type => "text", is_nullable => 1 }, +); + +=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, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-12-12 02:41:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9044j1OZyypCpGV71FgvYg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.20.1