changed truncate to delete

This commit is contained in:
Mark
2014-01-16 12:06:33 +04:00
parent c5022203de
commit dad238f60d
2 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,7 @@ class FixtureController extends Controller
$this->getDbConnection()->createCommand()->checkIntegrity(false)->execute();
foreach($tables as $table) {
$this->getDbConnection()->createCommand()->truncateTable($table)->execute();
$this->getDbConnection()->createCommand()->delete($table)->execute();
$this->getDbConnection()->createCommand()->resetSequence($table)->execute();
$this->stdout(" Table \"{$table}\" was successfully cleared. \n", Console::FG_GREEN);
}

View File

@ -142,7 +142,7 @@ class DbFixtureManager extends Component
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();
$fileName = $this->basePath . '/' . $tableName . '.php';