Commit dad238f6 by Mark

changed truncate to delete

parent c5022203
...@@ -175,7 +175,7 @@ class FixtureController extends Controller ...@@ -175,7 +175,7 @@ class FixtureController extends Controller
$this->getDbConnection()->createCommand()->checkIntegrity(false)->execute(); $this->getDbConnection()->createCommand()->checkIntegrity(false)->execute();
foreach($tables as $table) { foreach($tables as $table) {
$this->getDbConnection()->createCommand()->truncateTable($table)->execute(); $this->getDbConnection()->createCommand()->delete($table)->execute();
$this->getDbConnection()->createCommand()->resetSequence($table)->execute(); $this->getDbConnection()->createCommand()->resetSequence($table)->execute();
$this->stdout(" Table \"{$table}\" was successfully cleared. \n", Console::FG_GREEN); $this->stdout(" Table \"{$table}\" was successfully cleared. \n", Console::FG_GREEN);
} }
......
...@@ -142,7 +142,7 @@ class DbFixtureManager extends Component ...@@ -142,7 +142,7 @@ class DbFixtureManager extends Component
throw new InvalidConfigException("Table does not exist: $tableName"); throw new InvalidConfigException("Table does not exist: $tableName");
} }
$this->db->createCommand()->truncateTable($tableName)->execute(); $this->db->createCommand()->delete($tableName)->execute();
$this->db->createCommand()->resetSequence($tableName, 1)->execute(); $this->db->createCommand()->resetSequence($tableName, 1)->execute();
$fileName = $this->basePath . '/' . $tableName . '.php'; $fileName = $this->basePath . '/' . $tableName . '.php';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment