mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-04 22:57:40 +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();
|
$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
|
|||||||
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';
|
||||||
|
|||||||
Reference in New Issue
Block a user