Refactor upgrade scripts to better delete files and workflow activities.

This commit is contained in:
Colin Kuskie 2012-01-03 12:42:00 -08:00
parent d3b574da13
commit 0da6ffab15
3 changed files with 7 additions and 4 deletions

View file

@ -42,7 +42,6 @@ done;
start_step "Removing Admin Bar module";
my $webgui_root = realpath( File::Spec->catdir( WebGUI::Paths->configBase, (File::Spec->updir) x 1) );
unlink File::Spec->catfile($webgui_root, 'lib', 'WebGUI', 'Macro', 'AdminBar.pm');
rm_lib('WebGUI::Macro::AdminBar');
done;

View file

@ -11,7 +11,6 @@ done;
start_step "Removing FilePile asset module";
my $webgui_root = realpath( File::Spec->catdir( WebGUI::Paths->configBase, (File::Spec->updir) x 1 ) );
unlink File::Spec->catfile($webgui_root, 'lib', 'WebGUI', 'Asset', 'FilePile.pm');
rm_lib('WebGUI::Asset::FilePile');
done;

View file

@ -7,12 +7,17 @@ start_step "Removing WebGUI statistics workflows and code";
config->deleteFromHash( 'adminConsole', 'statistics' );
report "Deleting Workflow Activities";
my $activity = dbh->write(q|delete from WorkflowActivity where className='WebGUI::Workflow::Activity::SendWebguiStats'|);
report "Deleting Workflow and Cron";
my $workflow = WebGUI::Workflow->new(session, 'send_webgui_statistics');
$workflow->delete;
##This may not be in there if it is not enabled.
my $task = WebGUI::Workflow::Cron->new(session, 'send_webgui_statistics');
$task && $task->delete;
report "Deleting files";
my $webgui_root = realpath( File::Spec->catdir( WebGUI::Paths->configBase, (File::Spec->updir) x 1 ) );
unlink File::Spec->catfile($webgui_root, 'lib', 'WebGUI', 'Operation', 'Statistics.pm');
unlink File::Spec->catfile($webgui_root, 'lib', 'WebGUI', 'Workflow', 'Activity', 'SendWebguiStats.pm');