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
I don't have time to look at this deeper right now but CIDatabaseTestCase has steps to empty the database of tables on refresh:
// Delete all of the tables to ensure we're at a clean start.
$tables = $this->db->listTables();
if (is_array($tables))
{
$forge = Database::forge('tests');
foreach ($tables as $table)
{
if ($table === $this->db->DBPrefix . 'migrations')
{
continue;
}
$forge->dropTable($table, true);
}
}
But then it also refreshes migrations right after:
Since the migrations table is exempt from removal this will cause it to try rolling back migrations on tables that don't exist anymore, so if the migration's down() method doesn't check if_table_exists it will fail.
Probably just moving $this->migrations->regress(0, 'tests'); above the table removal will work?
The text was updated successfully, but these errors were encountered:
I don't have time to look at this deeper right now but CIDatabaseTestCase has steps to empty the database of tables on refresh:
But then it also refreshes migrations right after:
Since the migrations table is exempt from removal this will cause it to try rolling back migrations on tables that don't exist anymore, so if the migration's
down()
method doesn't checkif_table_exists
it will fail.Probably just moving
$this->migrations->regress(0, 'tests');
above the table removal will work?The text was updated successfully, but these errors were encountered: