-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post-migration actions and post-migration database views refreshing #112
Conversation
… be executed after migration. Changed the script for refreshing views.
Pridaj prosím o tom informáciu do dokumentácie |
Chýbajú mi tu unit testy. Je to knižnica, ktorú používa veľa projektov tak je potrebné aby zmeny boli pokryté unitestami. Je tam trieda Aspoň sa zoznámiš s unit testami. |
src/Migrations/MigrationOptions.cs
Outdated
var resourceName = $"{assembly.GetName().Name}.{DefaultResourceNamespace}.{scriptName}"; | ||
AddAfterMigrationAction(async (database, _) => | ||
{ | ||
Stream resourceStream = assembly.GetManifestResourceStream(resourceName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nejdem to teraz overovať, ale mám pocit, že GetManifestResourceStream
vracia nullabe stream, čiže by si mala použiť Stream?
. Ak je to tak tak prosím ešte over či je to null a ak áno tak vyhoď InvalidOperationException
.
A rovnako použi prosím using Stream? ...
. Pretože aj Stream
je disposable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pri jednom aj druhom usingu podľa mňa môžeš použiť await using
miesto using
. Ale istý som si není, neskúšal som to. Prosím skús.
…ntrv/Kros.KORM into add-post-migration-actions
Added post-migration actions and post-migration database views refresh with an option to accept the script ID up to which actions will be executed after migration. Added default script for refreshing views into resources.
Use:
Action will be executed only if the ID of the latest script of the migration is less than or equal to the user-defined ID. If the ID is not defined, the action will execute regardless.