From: <sco...@us...> - 2010-06-16 19:14:48
|
Revision: 23408 http://gmod.svn.sourceforge.net/gmod/?rev=23408&view=rev Author: scottcain Date: 2010-06-16 19:14:32 +0000 (Wed, 16 Jun 2010) Log Message: ----------- making --dematerialize delete the entry in the materialized_view table rather than just setting the period of update really long (it's not clear to me why this was done anyway). Modified Paths: -------------- schema/trunk/chado/bin/gmod_materialized_view_tool.pl Modified: schema/trunk/chado/bin/gmod_materialized_view_tool.pl =================================================================== --- schema/trunk/chado/bin/gmod_materialized_view_tool.pl 2010-06-16 19:11:44 UTC (rev 23407) +++ schema/trunk/chado/bin/gmod_materialized_view_tool.pl 2010-06-16 19:14:32 UTC (rev 23408) @@ -1,8 +1,6 @@ #!/usr/bin/perl use strict; -use lib '/home/cain/cvs_stuff/schema/chado/lib'; -use lib '/home/scott/cvs_stuff/schema/chado/lib'; use Bio::GMOD::Config; use Bio::GMOD::DB::Config; @@ -428,6 +426,7 @@ if ( $exists{$t} ) { print "MV '$_' already exists! Current names taken: " . join( ", ", @NAMES ) . "\n"; + die "$VIEWNAME already exists and must be explicitly removed with '--dematerialize $VIEWNAME'" if ($VIEWNAME); } unless ( $t =~ /^\w+$/ ) { print "Invalid format, use word characters only($t)\n"; @@ -818,12 +817,12 @@ my $create_view_query = "CREATE VIEW $schema.$table ($columns) AS $query"; $dbh->do($create_view_query) or die "problem creating view: ".$dbh->errstr; - #change refresh_time to make it near infinite - #that is, about 20 years + #this used to set the update time to 20 years rather than deleting the + #entry. Now it just deletes the entry my $update_query = $dbh->prepare( - "UPDATE materialized_view SET refresh_time=630720000 where name = ?"); + "DELETE FROM materialized_view WHERE name = ?"); $update_query->execute($view) - or die "problem changing refresh_time ".$dbh->errstr; + or die "problem delete deleted MV from materialized_view table: ".$dbh->errstr; $dbh->commit(); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |