How to collapse migrations into just one migration?

I have a failure in a migration and I just want to collapse my migration stack down to one without losing my data in the database. Any easy way to do this?

I believe db introspection is what you need. Possibly clearing up the migrations table too.
But it doesn’t generate a migration for the current state, at least I’m not aware of it.