I have difficulties finding concrete info on how Flyway works when validating. Is checksum applied over the migaration as a file or over the migration as actual db changes? Does it just compare content of migration files when applied over the db versus current content or is it someway aware of the information schema of db with its current state?
Flyway maintains a special table in the schema.
This table contains an information about all DB migrations that have been applied so far.
When it runs, flyway checks whether the codebase has new migration(s) compared to already applied from that table, if there are new migrations it applies them one by one, otherwise just finishes.
So, the source of knowledge for flyway is the schema that has flyway's own table.