Bugzilla – Attachment 35376 Details for
Bug 11023
Automatic item modification by age (Was "Toggle new status for items")
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11023: DB changes
Bug-11023-DB-changes.patch (text/plain), 4.91 KB, created by
Jonathan Druart
on 2015-01-19 12:31:33 UTC
(
hide
)
Description:
Bug 11023: DB changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-01-19 12:31:33 UTC
Size:
4.91 KB
patch
obsolete
>From 7d8487cff8426d8432e8ff8d73bc87c1100cdcdb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 25 Jun 2014 15:13:45 +0200 >Subject: [PATCH] Bug 11023: DB changes > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Schema/Result/Deleteditem.pm | 13 +++++++++++-- > Koha/Schema/Result/Item.pm | 13 +++++++++++-- > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > 4 files changed, 36 insertions(+), 4 deletions(-) > >diff --git a/Koha/Schema/Result/Deleteditem.pm b/Koha/Schema/Result/Deleteditem.pm >index f915511..5d450c9 100644 >--- a/Koha/Schema/Result/Deleteditem.pm >+++ b/Koha/Schema/Result/Deleteditem.pm >@@ -265,6 +265,13 @@ __PACKAGE__->table("deleteditems"); > is_nullable: 1 > size: 32 > >+=head2 new >+ >+ accessor: undef >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 32 >+ > =cut > > __PACKAGE__->add_columns( >@@ -365,6 +372,8 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 1, size => 32 }, > "stocknumber", > { data_type => "varchar", is_nullable => 1, size => 32 }, >+ "new", >+ { accessor => undef, data_type => "varchar", is_nullable => 1, size => 32 }, > ); > > =head1 PRIMARY KEY >@@ -380,8 +389,8 @@ __PACKAGE__->add_columns( > __PACKAGE__->set_primary_key("itemnumber"); > > >-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-24 09:58:16 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ru5DyaIlWJcMNAgpZRjOLg >+# Created by DBIx::Class::Schema::Loader v0.07041 @ 2014-11-05 09:42:42 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FuMIqaxfqRuclwG/pxrTtA > > > # You can replace this text with custom content, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 8ea22e3..aa03796 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -268,6 +268,13 @@ __PACKAGE__->table("items"); > is_nullable: 1 > size: 32 > >+=head2 new >+ >+ accessor: undef >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 32 >+ > =cut > > __PACKAGE__->add_columns( >@@ -373,6 +380,8 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 1, size => 32 }, > "stocknumber", > { data_type => "varchar", is_nullable => 1, size => 32 }, >+ "new", >+ { accessor => undef, data_type => "varchar", is_nullable => 1, size => 32 }, > ); > > =head1 PRIMARY KEY >@@ -609,8 +618,8 @@ __PACKAGE__->might_have( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-24 09:58:16 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2slVK/FjcRDiYLeufoOFQQ >+# Created by DBIx::Class::Schema::Loader v0.07041 @ 2014-11-05 09:42:42 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yCum/5krRX5Yv+qXQJ1QPg > > __PACKAGE__->belongs_to( > "biblio", >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 82868e7..dce0339 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -946,6 +946,7 @@ CREATE TABLE `deleteditems` ( > `enumchron` text default NULL, -- serial enumeration/chronology for the item (MARC21 952$h) > `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t) > `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i) >+ `new` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob. > PRIMARY KEY (`itemnumber`), > KEY `delitembarcodeidx` (`barcode`), > KEY `delitemstocknumberidx` (`stocknumber`), >@@ -1245,6 +1246,7 @@ CREATE TABLE `items` ( -- holdings/item information > `enumchron` text default NULL, -- serial enumeration/chronology for the item (MARC21 952$h) > `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t) > `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i) >+ `new` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob. > PRIMARY KEY (`itemnumber`), > UNIQUE KEY `itembarcodeidx` (`barcode`), > KEY `itemstocknumberidx` (`stocknumber`), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 4653c02..d3d91a0 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9669,6 +9669,18 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.19.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do(q{ >+ ALTER TABLE `items` ADD `new` VARCHAR(32) NULL AFTER `stocknumber`; >+ }); >+ $dbh->do(q{ >+ ALTER TABLE `deleteditems` ADD `new` VARCHAR(32) NULL AFTER `stocknumber`; >+ }); >+ print "Upgrade to $DBversion done (Bug 11023: Adds field 'new' in items and deleteditems tables)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >2.1.0
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 11023
:
21926
|
21932
|
21982
|
21983
|
22004
|
22386
|
22734
|
22735
|
24068
|
24069
|
24070
|
24146
|
24147
|
24148
|
25767
|
25833
|
26817
|
26818
|
26819
|
26820
|
26821
|
26822
|
26855
|
27810
|
29216
|
29217
|
29218
|
29219
|
29220
|
29221
|
29222
|
31820
|
31821
|
31822
|
33226
|
33227
|
33228
|
33229
|
33230
|
33231
|
33232
|
33233
|
33234
|
33235
|
34782
|
34783
|
34784
|
34785
|
34786
|
34787
|
34788
|
34789
|
34790
|
34791
|
34870
|
34871
|
34872
|
34873
|
34874
|
34875
|
34876
|
34877
|
34878
|
34879
|
34880
|
34881
|
34882
|
34883
|
35375
|
35376
|
41147
|
41148