changed truncate to delete

This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Mark
2014-01-16 12:06:33 +04:00
gitea-unlock(16/)
parent c5022203de
commit dad238f60d
octicon-diff(16/tw-mr-1) 2 changed files with 2 additions and 2 deletions

2
framework/console/controllers/FixtureController.php
View File

@@ -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);
} }

2
framework/test/DbFixtureManager.php
View File

@@ -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';