Bugzilla – Attachment 29222 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), 5.25 KB, created by
Jonathan Druart
on 2014-06-25 13:17:52 UTC
(
hide
)
Description:
Bug 11023: DB changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-06-25 13:17:52 UTC
Size:
5.25 KB
patch
obsolete
>From 0be1fab5c9b70d9693d023df599f22d6124ac64c 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 > >--- > Koha/Schema/Result/Deleteditem.pm | 13 +++++++++++-- > Koha/Schema/Result/Item.pm | 17 +++++++++++++---- > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > 4 files changed, 38 insertions(+), 6 deletions(-) > >diff --git a/Koha/Schema/Result/Deleteditem.pm b/Koha/Schema/Result/Deleteditem.pm >index 152d397..bac6db5 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.07025 @ 2013-12-23 16:39:42 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ji1W0q5g5xTw1J89cjVlWw >+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-06-25 15:02:46 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+qhg5GixwXyxf99J5CUI4w > > > # 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 fd50d15..e89b22d 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 >@@ -508,7 +517,7 @@ __PACKAGE__->belongs_to( > { > is_deferrable => 1, > join_type => "LEFT", >- on_delete => "CASCADE", >+ on_delete => "RESTRICT", > on_update => "CASCADE", > }, > ); >@@ -528,7 +537,7 @@ __PACKAGE__->belongs_to( > { > is_deferrable => 1, > join_type => "LEFT", >- on_delete => "CASCADE", >+ on_delete => "RESTRICT", > on_update => "CASCADE", > }, > ); >@@ -609,8 +618,8 @@ __PACKAGE__->might_have( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-12-19 06:29:02 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:h6fPG62SifJ5T8QKPZNBBw >+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-06-25 15:02:46 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:65YUTXGvZEgL1A/sI4dh1Q > > __PACKAGE__->belongs_to( > "biblio", >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index b46dc6a..84f6a57 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -920,6 +920,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 toggle_new_status cronjob. > PRIMARY KEY (`itemnumber`), > KEY `delitembarcodeidx` (`barcode`), > KEY `delitemstocknumberidx` (`stocknumber`), >@@ -1216,6 +1217,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 intended to be managed by the toggle_new_status 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 c68ba51..4310214 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8560,6 +8560,18 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.17.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.0.0.rc2
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