Home:ALL Converter>Fluentmigrator in database schema

Fluentmigrator in database schema

Ask Time:2022-01-19T16:56:16         Author:Avi

Json Formatter

I use Fluentmigrator in my Visual Studio project to version and migrate a single MS SQL Server database.

Within that db, there are multiple customer dedicated database schemas, and wish to migrate them independently from each other, hence each schema would have a dedicated VersionInfo table.

I see this might be possible with this, by overriding the meta data: https://fluentmigrator.github.io/articles/version-table-metadata.html

The next step would be to execute sql scripts against the target schema using

Execute.EmbeddedScript("...") 

statement in the migration class, but I don't see the InSchema member method.

(Unfortunately I need to use embedded scripts, as I have complex temporal table structure setups.)

How could I run Execute.EmbeddedScript against different schemas? The schema name is passed to my fluent migrator application via command line argument.

Author:Avi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70767750/fluentmigrator-in-database-schema
yy