fluentmigrator / documentation

This is the source of fluentmigrator.github.io
https://fluentmigrator.github.io
Creative Commons Attribution Share Alike 4.0 International
6 stars 18 forks source link

VersionTableMetadata info is out of date and inaccurate #69

Open AppFzx opened 9 months ago

AppFzx commented 9 months ago

https://github.com/fluentmigrator/documentation/blob/master/articles/version-table-metadata.md

Example leaves off ApplicationContext property of IVersionTableMetaData. Worse yet, the property is marked Obsolete so it's quite unclear what should happen here. A cryptic error while attempting to implement says use DI instead but DI of what? Using .Services.AddSingleton<IConventionSet>(new DefaultConventionSet(defaultSchemaName: "myschema", workingDirectory: null)) with Sql Server doesn't set the schema for version table to myschema, instead defaultSchemaName attempts to set the database!

This page needs an example that works. I tried digging through the code to make a PR and fix but it's unclear what the developer was attempting so it's hard to make any meaningful fix.

jzabroski commented 8 months ago

"Use DI" means:

The reason Application Context is obsolete is that it doesn't make sense to have it as a property when you could have a strongly typed thing you inject instead. The Context is typically dynamic/external resource, like an IConfiguationService. Additional things that are not Saga-like appplication context state that you might want to inject include your database access layer / library. For examples, NHibernate, EFCore, Dapper, RepoDB.

What problem are you trying to solve?

Using .Services.AddSingleton<IConventionSet>(new DefaultConventionSet(defaultSchemaName: "myschema", workingDirectory: null)) with Sql Server doesn't set the schema for version table to myschema, instead defaultSchemaName attempts to set the database!

I have not looked into this claim, this is a documentation repo, not the code repo. Did you look at how FluentMigrator.DotNet.Cli registers convention sets?