Well that’s mysterious. I was kinda expecting to find some rando rubbish in that record, but it looks like a regular migration.
More DB investigation: can you provide the output of the following commands, again in the psql command line (get in the same way as last time):
\d schema_migration_details_id_seq
select count(id),max(id) from schema_migration_details;
The first of these should produce a table that includes a line for last_value, while the second should just show how many rows and what the max value of the id column is. That’ll at least show the nature of the damage, although I doubt it’ll tell us exactly why it happened.