# MIGRATE_LEDGER_UNREADABLE

`nextly migrate` found a `nextly_migrations` table of an earlier Nextly release holding records it cannot read, so it moved none of them.

## Cause

`nextly migrate` found a `nextly_migrations` table of an earlier Nextly release holding records it cannot read, so it moved none of them.

An earlier release kept its migration records in `nextly_migrations`. `nextly migrate` moves them into `nextly_schema_events` and reads every record before writing any. It reads the two shapes `nextly migrate` and `nextly db:sync` kept the table in. This table has a record it cannot read: one with a status no release wrote, one naming no migration file, or a table of another shape that holds rows, such as the one the adapters' migration helper kept, whose records name a label rather than a migration file. So the run stopped before changing anything.

## Fix

* If Nextly did not create the table, rename it, then run `nextly migrate` again.
* If it holds your migration history, back up the database and open an issue with the record named in the message.

## Example

```text
✗ The table "nextly_migrations" holds records `nextly migrate` cannot read: the record of 0001_init.sql has the status "rolled_back".
  Why:  `nextly migrate` moves the records an earlier release kept in `nextly_migrations` into `nextly_schema_events`, and reads every one before writing any. One of them it cannot read, so nothing was changed.
  Next: Rename the table if Nextly did not create it, then run `nextly migrate` again.
  Docs: https://nextlyhq.com/docs/cli/errors/migrate-ledger-unreadable  (MIGRATE_LEDGER_UNREADABLE)
```
