CAP.L0.DOWN_FAILED — the down() leg raised an error
- Category: safety
- Level: 0
- Stability: stable
- Suites: lint
While --roundtrip replayed the migration in a throwaway database, its down() raised an error. This is the rollback path — the one that runs when a deploy is already going wrong — so discovering there that it does not work is the worst possible moment. The roundtrip finds it beforehand.
It is deliberately a different finding from CAP.L0.DOWN_NOT_INVERTIBLE, and the difference is not cosmetic. "Invertible" is a question about what down() left behind; a down() that did not finish left behind nothing anyone can reason about. Reporting the stronger verdict would be inventing evidence the run does not have. For the same reason the roundtrip stops here instead of running the second up: it would fail against an unplanned state, for a reason no reader could attribute to anything.
The finding carries the driver's own message, with connection credentials redacted and absolute paths relativized, so the same failure reads identically on every machine.
Flagged
public function down(): void
{
// Raises: the column was never added by this migration's up(),
// so the rollback path throws the moment it is needed — during a
// deploy that is already going wrong.
Schema::table('invoices', function (Blueprint $table): void {
$table->dropColumn('a_column_that_was_never_added');
});
}
Preferred
public function down(): void
{
Schema::table('invoices', function (Blueprint $table): void {
$table->dropColumn('reference');
});
}