I have the need to run a "epilogue/cleanup" SQL batch at the end of a Fluent Migrator database build. I need this to execute at the end regardless of how far or in what direction the fluent migration is being done (e.g. Up[grading], Down[grading], and stopping at whatever version of the database.)
In case you are wondering, I am executing code to ensure views are refreshed after the SQL DML execution is done.
Is there a way to do this or does such a script have to be executed outside the context of FluentMigrator.
Fluent migrator doesn't support that. What you could do is have an extension function to MigrationBase, in it the code/script you want to execute. Then call that function in all the Up and Down functions.
Have in mind that if you use AutoReservingMigrations, it won't work when down is executed.