View | Details | Raw Unified | Return to bug 23081
Collapse All | Expand All

(-)a/Koha/Schema/Result/Deleteditem.pm (-2 / +6 lines)
Lines 156-162 __PACKAGE__->table("deleteditems"); Link Here
156
=head2 issues
156
=head2 issues
157
157
158
  data_type: 'smallint'
158
  data_type: 'smallint'
159
  is_nullable: 1
159
  is_nullable: 0
160
  default_value: 0
160
161
161
=head2 renewals
162
=head2 renewals
162
163
Lines 341-347 __PACKAGE__->add_columns( Link Here
341
  "coded_location_qualifier",
342
  "coded_location_qualifier",
342
  { data_type => "varchar", is_nullable => 1, size => 10 },
343
  { data_type => "varchar", is_nullable => 1, size => 10 },
343
  "issues",
344
  "issues",
344
  { data_type => "smallint", is_nullable => 1 },
345
   { data_type => "smallint",
346
    is_nullable => 0,
347
    default_value => 0,
348
  },
345
  "renewals",
349
  "renewals",
346
  { data_type => "smallint", is_nullable => 1 },
350
  { data_type => "smallint", is_nullable => 1 },
347
  "reserves",
351
  "reserves",
(-)a/Koha/Schema/Result/Item.pm (-2 / +6 lines)
Lines 159-165 __PACKAGE__->table("items"); Link Here
159
=head2 issues
159
=head2 issues
160
160
161
  data_type: 'smallint'
161
  data_type: 'smallint'
162
  is_nullable: 1
162
  is_nullable: 0
163
  default_value: 0
163
164
164
=head2 renewals
165
=head2 renewals
165
166
Lines 355-361 __PACKAGE__->add_columns( Link Here
355
  "coded_location_qualifier",
356
  "coded_location_qualifier",
356
  { data_type => "varchar", is_nullable => 1, size => 10 },
357
  { data_type => "varchar", is_nullable => 1, size => 10 },
357
  "issues",
358
  "issues",
358
  { data_type => "smallint", is_nullable => 1 },
359
  { data_type => "smallint",
360
    is_nullable => 0,
361
    default_value => 0,
362
  },
359
  "renewals",
363
  "renewals",
360
  { data_type => "smallint", is_nullable => 1 },
364
  { data_type => "smallint", is_nullable => 1 },
361
  "reserves",
365
  "reserves",
(-)a/installer/data/mysql/atomicupdate/bug_23081-change-default-of-issues-field.perl (+15 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
     $dbh->do( "UPDATE items set issues=0 where issues is null" );
5
     $dbh->do( "UPDATE deleteditems set issues=0 where issues is null" );
6
     $dbh->do( "ALTER TABLE items ALTER issues set default 0" );
7
     $dbh->do( "ALTER TABLE deleteditems ALTER issues set default 0" );
8
    # or perform some test and warn
9
    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
10
    #    warn "There is something wrong";
11
    # }
12
13
    # Always end with this (adjust the bug info)
14
    NewVersion( $DBversion, 23081, "Set default to 0 for items.issues");
15
}
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 638-644 CREATE TABLE `deleteditems` ( Link Here
638
  `withdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
638
  `withdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
639
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
639
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
640
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
640
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
641
  `issues` smallint(6) default NULL, -- number of times this item has been checked out
641
  `issues` smallint(6) default 0, -- number of times this item has been checked out
642
  `renewals` smallint(6) default NULL, -- number of times this item has been renewed
642
  `renewals` smallint(6) default NULL, -- number of times this item has been renewed
643
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
643
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
644
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
644
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
Lines 843-849 CREATE TABLE `items` ( -- holdings/item information Link Here
843
  `withdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
843
  `withdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
844
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
844
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
845
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
845
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
846
  `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
846
  `issues` smallint(6) default 0, -- number of times this item has been checked out/issued
847
  `renewals` smallint(6) default NULL, -- number of times this item has been renewed
847
  `renewals` smallint(6) default NULL, -- number of times this item has been renewed
848
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
848
  `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
849
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
849
  `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
850
- 

Return to bug 23081