remove all tables before inserting tables creation
This commit is contained in:
@@ -54,6 +54,13 @@ class ReloadDatabaseCommand extends BaseModuleGenerate
|
|||||||
$connection = Propel::getConnection(\Thelia\Model\Map\ProductTableMap::DATABASE_NAME);
|
$connection = Propel::getConnection(\Thelia\Model\Map\ProductTableMap::DATABASE_NAME);
|
||||||
$connection = $connection->getWrappedConnection();
|
$connection = $connection->getWrappedConnection();
|
||||||
|
|
||||||
|
$tables = $connection->query("SHOW TABLES");
|
||||||
|
$connection->query("SET FOREIGN_KEY_CHECKS = 0");
|
||||||
|
foreach($tables as $table) {
|
||||||
|
$connection->query(sprintf("DROP TABLE `%s`", $table[0]));
|
||||||
|
}
|
||||||
|
$connection->query("SET FOREIGN_KEY_CHECKS = 1");
|
||||||
|
|
||||||
$database = new Database($connection);
|
$database = new Database($connection);
|
||||||
$output->writeln(array(
|
$output->writeln(array(
|
||||||
'',
|
'',
|
||||||
|
|||||||
Reference in New Issue
Block a user