Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactor upgrade scripts to better delete files and workflow activities.
  • Loading branch information
perlDreamer committed Jan 3, 2012
1 parent d3b574d commit 0da6ffa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions share/upgrades/7.10.23-8.0.0/removeAdminBar.pl
Expand Up @@ -42,7 +42,6 @@

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;
3 changes: 1 addition & 2 deletions share/upgrades/7.10.23-8.0.0/removeFilePile.pl
Expand Up @@ -11,7 +11,6 @@

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;
5 changes: 5 additions & 0 deletions share/upgrades/7.10.23-8.0.0/removeWebGUIStatistics.pl
Expand Up @@ -7,12 +7,17 @@

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');
Expand Down

0 comments on commit 0da6ffa

Please sign in to comment.