mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
changed truncate to delete
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
Reference in New Issue
Block a user