*/
class ReloadDatabaseCommand extends BaseModuleGenerate
{
public function configure()
{
$this
->setName("thelia:dev:reloadDB")
->setDescription("erase current database and create new one")
/* ->addOption(
"load-fixtures",
null,
InputOption::VALUE_NONE,
"load fixtures in databases"
)*/
;
}
public function execute(InputInterface $input, OutputInterface $output)
{
/** @var ConnectionWrapper $connection */
$connection = Propel::getConnection(ProductTableMap::DATABASE_NAME);
$connection = $connection->getWrappedConnection();
$database = new Database($connection);
$output->writeln(array(
'',
'starting reloaded database, please wait'
));
$database->insertSql();
$output->writeln(array(
'',
'Database reloaded with success',
''
));
}
}