Skip to content

Commit

Permalink
Clean up database after migration by default
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Apr 26, 2017
1 parent 69620df commit f727239
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Classes/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ public static function execute()
$ctx->setConfig( new \Aimeos\MW\Config\Decorator\Memory( $config, $local ) );

$manager = new \Aimeos\MW\Setup\Manager\Multiple( $dbm, $dbconfig, $taskPaths, $ctx );
$manager->migrate();

if( isset( $conf['cleanDb'] ) && (boolean) $conf['cleanDb'] === true ) {
$manager->clean();
} else {
$manager->migrate();
}


$conf['useDemoData'] = $conf['cleanDb'] = '';
$conf['useDemoData'] = '';
$utility->writeConfiguration( $conf, 'aimeos' );
}

Expand Down
2 changes: 1 addition & 1 deletion ext_conf_template.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cat=basic/site; type=string; label=Site code:Create or update the site with this code
siteCode = default
# cat=basic/cleanup; type=boolean; label=Cleanup old columns and indexes:Removes the table columns and indexes that are not used any more when installing a new version
cleanDb = 0
cleanDb = 1
# cat=basic/demo; type=options[Remove=0,No action=,Overwrite=1]; label=Updates demo data:Adds a new set of demo data, keeps the current set untouched or removes the existing demo data during execution of the update script. This setting will be reset to "No action" after the setup tasks have been executed.
useDemoData = 1
# cat=basic/realurl; type=boolean; label=Use auto-configuration for RealUrl:If the internal RealUrl auto-configuration for Aimeos plugins should be used
Expand Down

0 comments on commit f727239

Please sign in to comment.