From 36e9e9ccf500ae3bd2d6bb3ae8a151243841422d Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Tue, 24 Mar 2020 12:13:27 +0000
Subject: [PATCH] Bug 15326: DO NOT PUSH - Schema changes

---
 Koha/Schema/Result/Branch.pm  |  19 +++++-
 Koha/Schema/Result/CmsPage.pm | 150 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 167 insertions(+), 2 deletions(-)
 create mode 100644 Koha/Schema/Result/CmsPage.pm

diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm
index 92aa05b220..8e14817b11 100644
--- a/Koha/Schema/Result/Branch.pm
+++ b/Koha/Schema/Result/Branch.pm
@@ -458,6 +458,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 cms_pages
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::CmsPage>
+
+=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
@@ -729,8 +744,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-10 09:57:08
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:juk2V/100I2EIrxFNhjI7A
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 11:48:48
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o2D3F6aSr3Hs5TU6A2DAuQ
 
 __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..d5f71e30ff
--- /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<cms_pages>
+
+=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</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,
+    join_type     => "LEFT",
+    on_delete     => "CASCADE",
+    on_update     => "CASCADE",
+  },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 11:48:48
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3dEBop3bV7JUyl768HVlbg
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
-- 
2.11.0