How to know the migration is completed? #1548
-
Describe the question Documentation Pages You've Read So Far(https://fluentmigrator.github.io/api/v3.x/FluentMigrator.Runner.TrackingMigrationScope.html) Expected benefit Information (please complete the following information):
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You can create a "maintenance migration" (with the This migration stage will now be called after each successfully applied migration. EDIT: You cannot use |
Beta Was this translation helpful? Give feedback.
-
I don't understand the question. The migration is complete when the code returns. That is the callback mechanism. Are you asking in the case where you use the dotnet-fm CLI tool? If so, as Mark suggested, you can write some kind of paging mechanism in an MaintenanceMigration w/ MigrationStage.AfterAll - like, email notification, etc. But you wouldn't be able to write the transcript from there. I normally use Octopus Deploy to manage logging my transcripts and notifying of completed or failed deploys. We've been using it for over 5 years now. Works great. |
Beta Was this translation helpful? Give feedback.
-
@fubar-coder @jzabroski Thank you for the feedback. I am not using the migrator in CLI but in-process, after read the documentation, so far do not found the call back mechanism you mentioned. Possible to share me the direction of call back mechanism? Below is the code that I'm using to run the migrator
The work around I did currently is, I created CustomLoggerProvider and CustomRunnerLogger which inherit and implement from ILoggerProvider and FluentMigratorRunnerLogger. And I do some override in CustomRunnerLogger, so I can hijet the message pass to WriteSay function, and return back to application as log. To detect the complition of migration I did some dirty solution by detect "migrated" in the message. |
Beta Was this translation helpful? Give feedback.
@fubar-coder @jzabroski Thank you for the feedback. I am not using the migrator in CLI but in-process, after read the documentation, so far do not found the call back mechanism you mentioned. Possible to share me the direction of call back mechanism?
Below is the code that I'm using to run the migrator