[Koha-cvs] koha/updater updatedatabase [rel_3_0]
paul poulain
paul at koha-fr.org
Wed Oct 11 17:22:23 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch: rel_3_0
Changes by: paul poulain <tipaul> 06/10/11 15:22:23
Modified files:
updater : updatedatabase
Log message:
- adding some missing fields, coming from dev_week :
* lcsort & ccode in biblioitems table. lcsort is used for loc callnumbers & ccode is used to have a item level circulation rules. Ccode means C<irc>code
* onloan & issue_date in items table. They are filled by the misc/update_items.pl script, with circulation values. NOW, onloan & issue_date in items are NOT set by circulation, this decision speed up a lot the circulation rate (with the Date::Manip removal). The price for this is to have the status of the item not real time updated in zebra, but that's worth the price.
* cutterextra in items, that we should ask tumer to understand what it does ;-)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&only_with_tag=rel_3_0&r1=1.157.2.6&r2=1.157.2.7
Patches:
Index: updatedatabase
===================================================================
RCS file: /sources/koha/koha/updater/updatedatabase,v
retrieving revision 1.157.2.6
retrieving revision 1.157.2.7
diff -u -b -r1.157.2.6 -r1.157.2.7
--- updatedatabase 10 Oct 2006 11:25:40 -0000 1.157.2.6
+++ updatedatabase 11 Oct 2006 15:22:23 -0000 1.157.2.7
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: updatedatabase,v 1.157.2.6 2006/10/10 11:25:40 btoumi Exp $
+# $Id: updatedatabase,v 1.157.2.7 2006/10/11 15:22:23 tipaul Exp $
# Database Updater
# This script checks for required updates to the database.
@@ -189,12 +189,12 @@
notifys => "(
notify_id int(11) NOT NULL default '0',
- borrowernumber` int(11) NOT NULL default '0',
- itemnumber` int(11) NOT NULL default '0',
- notify_date` date NOT NULL default '0000-00-00',
- notify_send_date` date default NULL,
- notify_level` int(1) NOT NULL default '0',
- method` varchar(20) NOT NULL default '',
+ `borrowernumber` int(11) NOT NULL default '0',
+ `itemnumber` int(11) NOT NULL default '0',
+ `notify_date` date NOT NULL default '0000-00-00',
+ `notify_send_date` date default NULL,
+ `notify_level` int(1) NOT NULL default '0',
+ `method` varchar(20) NOT NULL default '',
KEY `borrowernumber` (`borrowernumber`,`itemnumber`)
)",
@@ -216,7 +216,7 @@
aqbookfund => { 'branchcode' => 'varchar(4) NULL'},
aqbudget => { 'branchcode' => 'varchar(4) NULL'},
auth_header => { 'marc' => 'BLOB NOT NULL', 'linkid' => 'BIGINT(20) NULL'},
- auth_subfield_structure =>{ 'hidden' => 'TINYINT(3) NOT NULL UNSIGNED ZEROFILL', 'kohafield' => 'VARCHAR(45) NOT NULL', 'linkid' => 'TINYINT(1) NOT NULL UNSIGNED', 'isurl' => 'TINYINT(1) UNSIGNED'},
+ auth_subfield_structure =>{ 'hidden' => 'TINYINT(3) NOT NULL default 0', 'kohafield' => 'VARCHAR(45) NOT NULL', 'linkid' => 'TINYINT(1) NOT NULL', 'isurl' => 'TINYINT(1)'},
serial =>{ 'publisheddate' => 'date', 'itemnumber'=>'text NULL','routingnotes'=>'text NULL',},
statistics => { 'associatedborrower' => 'integer'},
# tablename => { 'field' => 'fieldtype' },
@@ -626,6 +626,68 @@
extra => '',
},
],
+ biblioitems => [
+ {
+ field => 'lcsort',
+ type => 'varchar(25)',
+ null => 'NULL',
+ key => '',
+ default => '',
+ extra => '',
+ },
+ {
+ field => 'ccode',
+ type => 'varchar(4)',
+ null => 'NULL',
+ key => '',
+ default => '',
+ extra => '',
+ },
+ ],
+ items => [
+ {
+ field => 'onloan',
+ type => 'date',
+ null => 'NULL',
+ key => '',
+ default => '0000-00-00',
+ extra => '',
+ },
+ {
+ field => 'cutterextra',
+ type => 'varchar(45)',
+ null => 'NULL',
+ key => '',
+ default => '',
+ extra => '',
+ },
+ {
+ field => 'issue_date',
+ type => 'date',
+ null => 'NULL',
+ key => '',
+ default => '',
+ extra => '',
+ },
+ ],
+ systempreferences => [
+ {
+ field => 'value',
+ type => 'text',
+ null => 'NULL',
+ key => '',
+ default => '',
+ extra => '',
+ },
+ {
+ field => 'explanation',
+ type => 'text',
+ null => 'NULL',
+ key => '',
+ default => '',
+ extra => '',
+ },
+ ],
);
my %indexes = (
@@ -1290,7 +1352,7 @@
# synch table and deletedtable.
foreach my $table (('borrowers','items','biblio','biblioitems')) {
my %deletedborrowers;
- print "synch'ing $table\n";
+ print "synch'ing $table and deleted$table\n";
$sth = $dbh->prepare("show columns from deleted$table");
$sth->execute;
while ( my ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow ) {
@@ -1307,7 +1369,7 @@
} else {
$newcol .= " NOT NULL ";
}
- $newcol .= "default $default" if $default;
+ $newcol .= "default ".$dbh->quote($default) if $default;
$newcol .= " after $previous" if $previous;
$previous=$column;
print "creating column $column\n";
@@ -1728,6 +1790,12 @@
exit;
# $Log: updatedatabase,v $
+# Revision 1.157.2.7 2006/10/11 15:22:23 tipaul
+# - adding some missing fields, coming from dev_week :
+# * lcsort & ccode in biblioitems table. lcsort is used for loc callnumbers & ccode is used to have a item level circulation rules. Ccode means C<irc>code
+# * onloan & issue_date in items table. They are filled by the misc/update_items.pl script, with circulation values. NOW, onloan & issue_date in items are NOT set by circulation, this decision speed up a lot the circulation rate (with the Date::Manip removal). The price for this is to have the status of the item not real time updated in zebra, but that's worth the price.
+# * cutterextra in items, that we should ask tumer to understand what it does ;-)
+#
# Revision 1.157.2.6 2006/10/10 11:25:40 btoumi
# add two tables : notifys , charges
# modify accountlines tables add two fields (notify_id and notify_level)
More information about the Koha-cvs
mailing list