You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...because if the table doesn't exists and when executing Table::executeActions(), the actions will contain DropTable and a dynamically added CreateTable action. That makes no sense.
This is due to the following code:
/** * Executes all the pending actions for this table * * @param bool $exists Whether or not the table existed prior to executing this method * @return void */protectedfunctionexecuteActions(bool$exists): void
{
/* ... */// If the table does not exist, the last command in the chain needs to be// a CreateTable action.if (! $exists) {
$this->actions->addAction(newCreateTable($this->table));
}
/* ... */
}
The documentation says to use the following code when deleting a table:
https://book.cakephp.org/phinx/0/en/migrations.html#dropping-a-table
But in my opinion it's better using:
...because if the table doesn't exists and when executing
Table::executeActions()
, the actions will containDropTable
and a dynamically addedCreateTable
action. That makes no sense.This is due to the following code:
phinx/src/Phinx/Db/Table.php
Line 716 in b2eef81
So am I using the
save
andupdate
methods in a wrong way and then the documentation needs to be changed or is it a bug?The text was updated successfully, but these errors were encountered: