[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/updater updatedatabase [rel_3_0]
From: |
Antoine Farnault |
Subject: |
[Koha-cvs] koha/updater updatedatabase [rel_3_0] |
Date: |
Wed, 06 Dec 2006 13:49:41 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_3_0
Changes by: Antoine Farnault <toins> 06/12/06 13:49:41
Modified files:
updater : updatedatabase
Log message:
deleting additionalauthors, bibliosubjects, bibliosubtitles.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&only_with_tag=rel_3_0&r1=1.157.2.31&r2=1.157.2.32
Patches:
Index: updatedatabase
===================================================================
RCS file: /sources/koha/koha/updater/updatedatabase,v
retrieving revision 1.157.2.31
retrieving revision 1.157.2.32
diff -u -b -r1.157.2.31 -r1.157.2.32
--- updatedatabase 5 Dec 2006 15:07:16 -0000 1.157.2.31
+++ updatedatabase 6 Dec 2006 13:49:41 -0000 1.157.2.32
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: updatedatabase,v 1.157.2.31 2006/12/05 15:07:16 tipaul Exp $
+# $Id: updatedatabase,v 1.157.2.32 2006/12/06 13:49:41 toins Exp $
# Database Updater
# This script checks for required updates to the database.
@@ -225,8 +225,11 @@
# tablename => { 'field' => 'fieldtype' },
);
-my %dropable_table = (
-# tablename => 'tablename',
+# Enter here the table to delete.
+my @TableToDelete = qw(
+ additionalauthors
+ bibliosubject
+ bibliosubtitle
);
my %uselessfields = (
@@ -863,11 +866,6 @@
content => 'itemnumber',
}
],
- bibliosubject => [
- { indexname => 'biblionumber',
- content => 'biblionumber',
- }
- ],
items => [
{ indexname => 'homebranch',
content => 'homebranch',
@@ -989,22 +987,6 @@
onDelete => 'RESTRICT',
},
],
- additionalauthors => [
- { key => 'biblionumber',
- foreigntable => 'biblio',
- foreignkey => 'biblionumber',
- onUpdate => 'CASCADE',
- onDelete => 'CASCADE',
- },
- ],
- bibliosubject => [
- { key => 'biblionumber',
- foreigntable => 'biblio',
- foreignkey => 'biblionumber',
- onUpdate => 'CASCADE',
- onDelete => 'CASCADE',
- },
- ],
aqbasket => [
{ key => 'booksellerid',
foreigntable => 'aqbooksellers',
@@ -1434,19 +1416,6 @@
); # %linetodelete
-print "removing some unused data...\n";
-foreach my $table ( keys %linetodelete ) {
- foreach my $where ( @{linetodelete{$table}} ){
- print "DELETE FROM ".$table." where ".$where;
- my $sth = $dbh->prepare("DELETE FROM $table where $where");
- $sth->execute;
- if ( $sth->err ) {
- print "Error : $sth->errstr \n";
- }
- }
-}
-
-
#-------------------
# Initialize
@@ -1484,17 +1453,6 @@
} # unless exists
} # foreach
-# now drop useless tables
-foreach $table ( keys %dropable_table ) {
- if ( $existingtables{$table} ) {
- print "Dropping unused table $table\n" if $debug and not $silent;
- $dbh->do("drop table $table");
- if ( $dbh->err ) {
- print "Error : $dbh->errstr \n";
- }
- }
-}
-
#---------------------------------
# Columns
@@ -1597,8 +1555,20 @@
}
}
-# Populate tables with required data
+print "removing some unused data...\n";
+foreach my $table ( keys %linetodelete ) {
+ foreach my $where ( @{linetodelete{$table}} ){
+ print "DELETE FROM ".$table." where ".$where;
+ print "\n";
+ my $sth = $dbh->prepare("DELETE FROM $table where $where");
+ $sth->execute;
+ if ( $sth->err ) {
+ print "Error : $sth->errstr \n";
+ }
+ }
+}
+# Populate tables with required data
# synch table and deletedtable.
foreach my $table (('borrowers','items','biblio','biblioitems')) {
@@ -1759,6 +1729,16 @@
}
}
}
+# now drop useless tables
+foreach $table ( @TableToDelete ) {
+ if ( $existingtables{$table} ) {
+ print "Dropping unused table $table\n" if $debug and not $silent;
+ $dbh->do("drop table $table");
+ if ( $dbh->err ) {
+ print "Error : $dbh->errstr \n";
+ }
+ }
+}
#
# SPECIFIC STUFF
@@ -2030,6 +2010,9 @@
exit;
# $Log: updatedatabase,v $
+# Revision 1.157.2.32 2006/12/06 13:49:41 toins
+# deleting additionalauthors, bibliosubjects, bibliosubtitles.
+#
# Revision 1.157.2.31 2006/12/05 15:07:16 tipaul
# NEW FEATURE :
# a column (itemtypes.summary) has been added.
- [Koha-cvs] koha/updater updatedatabase [rel_3_0],
Antoine Farnault <=
- [Koha-cvs] koha/updater updatedatabase [rel_3_0], Bruno Toumi, 2006/12/06
- [Koha-cvs] koha/updater updatedatabase [rel_3_0], Henri-Damien LAURENT, 2006/12/08
- [Koha-cvs] koha/updater updatedatabase [rel_3_0], Henri-Damien LAURENT, 2006/12/13
- [Koha-cvs] koha/updater updatedatabase [rel_3_0], LAURIN arnaud, 2006/12/19
- [Koha-cvs] koha/updater updatedatabase [rel_3_0], Antoine Farnault, 2006/12/20