Skip to content

Auto Migrate on Nuget restore (or similar) #625

Description

@ChrisonSimtian

Description

As per @IT-VBFK 's suggestion, what about running the migration automatically via a flag?
<FalloutAutoMigrate> could trigger
a) upgrading the Fallout packages to a newer version
b) run the migrate cli to tackle the migration

This could also be something that goes into an IDE extension similar to the dotnet upgrade tool back in the dotnet framework to dotnet core days

Usage Example

No response

Alternative

No response

Could you help with a pull-request?

No

Activity

  1. IT-VBFK commented on Aug 6, 2026

    @IT-VBFK
    Contributor

    what about running the migration automatically via a flag?

    I actually meant a new option which a migration/setup would add.
    Like; Do you want to automatically run migrations in future on Fallout updates? (Y/n)

    On "Y": add a dedicated MSBuild Property to the users csproj like: <FalloutAutoMigrate>true</FalloutAutoMigrate>
    On "n": either add a decaated property with explicit false, or skip this

    Then, the mechanism should check the value of this variable and if true the auto-migration runs, if false or null auto-migration is ignored... like an opt-in to such behavior

  2. IT-VBFK commented on Aug 9, 2026

    @IT-VBFK
    Contributor

    I searched a few options for this:

    Roughly this how I think can work:

    • Add a .targets file with following content (Before CoreCompile is the safer way of After Restore, because of how dotnet restore works):
    <Target Name="Fallout_AutoMigrate"
            BeforeTargets="CoreCompile"
            Condition="'$(FalloutAutoMigrate)' == 'true'">
        ...
    </Target>
    • Add some sort of marker file like (this is to run the migration only once per version, should also work in CI/CD pipelines):
    obj/
    └── Fallout/
        └── fallout-version-x.y.z.marker
    
    • Search a tool (globally and locally) with the new FalloutVersion and install if needed (maybe just local in such a case) inside the conditional block
    • Run the command fallout-migrate or dotnet run fallout-migrate inside the conditional block
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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions