I like to think about a single migration being a function and a migration history multiple functions being composed.
Category theory's main subject (I think) is composition and a lot of good ideas can be taken from there (see this paper: "Functorial Data Migration"[1]).
There is an obvious relationship between a schema and the data, and a migration operates on both. The schema might be versioned, but unless you use a Schema-less database (ie: MongoDB) and handle the data versioning application side, your data is not.
Any document/graph-based database can avoid this problem by assigning a version to your documents (like apiVersion+kind in Kubernetes), then the application should know how to process each version of the data.
In an SQL database, it would require different tables which complexify the data model.
IMHO, in every case, you need to handle some of the logic application side or maintain an history of your data (bye-bye storage space?).