Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

VersionTableMetadata info is out of date and inaccurate #69

Open

Description

@AppFzx

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.

Activity

  1. jzabroski commented on Feb 19, 2024

    @jzabroski
    Contributor

    "Use DI" means:

    • Set-up your own in-process runner where you register dependencies, rather than using dotnet-fm CLI tool or the legacy CLI, etc.
    • In the in-process runner, you can add constructors to your Migrations and have those migrations take an IApplicationContext dependency that can be whatever you want - the type does not even need to be called IApplicationContext.

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions