Bugzilla – Attachment 122880 Details for
Bug 24387
Rename News tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24387: DBIC schema changes
Bug-24387-DBIC-schema-changes.patch (text/plain), 8.39 KB, created by
Martin Renvoize (ashimema)
on 2021-07-16 09:57:13 UTC
(
hide
)
Description:
Bug 24387: DBIC schema changes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-07-16 09:57:13 UTC
Size:
8.39 KB
patch
obsolete
>From 60bdac452c44ba702ab7bb656792c57ab49d1ad0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 16 Jul 2021 09:13:34 +0200 >Subject: [PATCH] Bug 24387: DBIC schema changes > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../{OpacNews.pm => AdditionalContent.pm} | 92 ++++++++++++++----- > Koha/Schema/Result/Borrower.pm | 34 +++---- > Koha/Schema/Result/Branch.pm | 34 +++---- > 3 files changed, 104 insertions(+), 56 deletions(-) > rename Koha/Schema/Result/{OpacNews.pm => AdditionalContent.pm} (62%) > >diff --git a/Koha/Schema/Result/OpacNews.pm b/Koha/Schema/Result/AdditionalContent.pm >similarity index 62% >rename from Koha/Schema/Result/OpacNews.pm >rename to Koha/Schema/Result/AdditionalContent.pm >index fc86e19139..080af4a169 100644 >--- a/Koha/Schema/Result/OpacNews.pm >+++ b/Koha/Schema/Result/AdditionalContent.pm >@@ -1,12 +1,12 @@ > use utf8; >-package Koha::Schema::Result::OpacNews; >+package Koha::Schema::Result::AdditionalContent; > > # Created by DBIx::Class::Schema::Loader > # DO NOT MODIFY THE FIRST PART OF THIS FILE > > =head1 NAME > >-Koha::Schema::Result::OpacNews >+Koha::Schema::Result::AdditionalContent > > =cut > >@@ -15,11 +15,11 @@ use warnings; > > use base 'DBIx::Class::Core'; > >-=head1 TABLE: C<opac_news> >+=head1 TABLE: C<additional_contents> > > =cut > >-__PACKAGE__->table("opac_news"); >+__PACKAGE__->table("additional_contents"); > > =head1 ACCESSORS > >@@ -30,7 +30,31 @@ __PACKAGE__->table("opac_news"); > is_auto_increment: 1 > is_nullable: 0 > >-unique identifier for the news article >+unique identifier for the additional content >+ >+=head2 category >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 20 >+ >+category for the additional content >+ >+=head2 code >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 20 >+ >+code to group content per lang >+ >+=head2 location >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 255 >+ >+location of the additional content > > =head2 branchcode > >@@ -39,7 +63,7 @@ unique identifier for the news article > is_nullable: 1 > size: 10 > >-branch code users to create branch specific news, NULL is every branch. >+branch code users to create branch specific additional content, NULL is every branch. > > =head2 title > >@@ -48,23 +72,23 @@ branch code users to create branch specific news, NULL is every branch. > is_nullable: 0 > size: 250 > >-title of the news article >+title of the additional content > > =head2 content > > data_type: 'mediumtext' > is_nullable: 0 > >-the body of your news article >+the body of your additional content > > =head2 lang > > data_type: 'varchar' > default_value: (empty string) > is_nullable: 0 >- size: 50 >+ size: 25 > >-location for the article (koha is the staff interface, slip is the circulation receipt and language codes are for the opac) >+location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac) > > =head2 published_on > >@@ -89,14 +113,14 @@ last modification > datetime_undef_if_invalid: 1 > is_nullable: 1 > >-date the article is set to expire or no longer be visible >+date the additional content is set to expire or no longer be visible > > =head2 number > > data_type: 'integer' > is_nullable: 1 > >-the order in which this article appears in that specific location >+the order in which this additional content appears in that specific location > > =head2 borrowernumber > >@@ -104,7 +128,7 @@ the order in which this article appears in that specific location > is_foreign_key: 1 > is_nullable: 1 > >-The user who created the news article >+The user who created the additional content > > =cut > >@@ -116,6 +140,12 @@ __PACKAGE__->add_columns( > is_auto_increment => 1, > is_nullable => 0, > }, >+ "category", >+ { data_type => "varchar", is_nullable => 0, size => 20 }, >+ "code", >+ { data_type => "varchar", is_nullable => 0, size => 20 }, >+ "location", >+ { data_type => "varchar", is_nullable => 0, size => 255 }, > "branchcode", > { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, > "title", >@@ -123,7 +153,7 @@ __PACKAGE__->add_columns( > "content", > { data_type => "mediumtext", is_nullable => 0 }, > "lang", >- { data_type => "varchar", default_value => "", is_nullable => 0, size => 50 }, >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 25 }, > "published_on", > { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, > "updated_on", >@@ -153,6 +183,29 @@ __PACKAGE__->add_columns( > > __PACKAGE__->set_primary_key("idnew"); > >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<additional_contents_uniq> >+ >+=over 4 >+ >+=item * L</category> >+ >+=item * L</code> >+ >+=item * L</branchcode> >+ >+=item * L</lang> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint( >+ "additional_contents_uniq", >+ ["category", "code", "branchcode", "lang"], >+); >+ > =head1 RELATIONS > > =head2 borrowernumber >@@ -196,14 +249,9 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Edd8K7ANL49fG7FKjwyRVQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-16 07:12:03 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0HtqQpArwFtGrsivukyG1Q > >-sub koha_object_class { >- 'Koha::NewsItem'; >-} >-sub koha_objects_class { >- 'Koha::News'; >-} > >+# You can replace this text with custom code or comments, and it will be preserved on regeneration > 1; >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 68abbc11aa..f0332fcfe9 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -869,6 +869,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 additional_contents >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::AdditionalContent> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "additional_contents", >+ "Koha::Schema::Result::AdditionalContent", >+ { "foreign.borrowernumber" => "self.borrowernumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 advanced_editor_macros > > Type: has_many >@@ -1439,21 +1454,6 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 opac_news >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::OpacNews> >- >-=cut >- >-__PACKAGE__->has_many( >- "opac_news", >- "Koha::Schema::Result::OpacNews", >- { "foreign.borrowernumber" => "self.borrowernumber" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 patron_consents > > Type: has_many >@@ -1875,8 +1875,8 @@ Composing rels: L</aqorder_users> -> ordernumber > __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 13:40:00 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IKPb4912o8oCHtmFAi6FPQ >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-16 07:12:03 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SWOGE6/WDsjzXcgfxmVQ4A > > __PACKAGE__->add_columns( > '+anonymized' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index 87f4ec190f..500d100d05 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -301,6 +301,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 additional_contents >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::AdditionalContent> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "additional_contents", >+ "Koha::Schema::Result::AdditionalContent", >+ { "foreign.branchcode" => "self.branchcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 aqbaskets > > Type: has_many >@@ -721,21 +736,6 @@ __PACKAGE__->might_have( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 opac_news >- >-Type: has_many >- >-Related object: L<Koha::Schema::Result::OpacNews> >- >-=cut >- >-__PACKAGE__->has_many( >- "opac_news", >- "Koha::Schema::Result::OpacNews", >- { "foreign.branchcode" => "self.branchcode" }, >- { cascade_copy => 0, cascade_delete => 0 }, >-); >- > =head2 problem_reports > > Type: has_many >@@ -887,8 +887,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uu8m3hyDhM50oTSeNTJbdg >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-16 07:12:03 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EZYvCbpv41QSEhHRPVFImA > > __PACKAGE__->add_columns( > '+pickup_location' => { is_boolean => 1 } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24387
:
122737
|
122738
|
122746
|
122748
|
122872
|
122873
|
122874
|
122878
|
122879
|
122880
|
123730
|
123731
|
123732
|
123733
|
123734
|
123795
|
123796
|
123797
|
123798
|
123803
|
123811
|
123854
|
123855
|
123856
|
124867
|
125545
|
142653