Skip to content

Running Grate on RoundhousE database - all scripts are new #550

@Edgaras91

Description

@Edgaras91

Describe the bug
Using grate.sqlserver, HasRun() check is fetching scripts from RoundhousE.GrateScriptsRun which is wrong when trying to run my scripts (xxxx.NewAddressColumns.sql). My scripts already ran and are in RoundhousE.ScriptsRun table.

To Reproduce
Have an existing RoundhousE tables such as "RoundhousE.ScriptsRun". Specify the "RoundhousE" schema in start-up.

Expected behavior
The existing RoundhousE script to not run again.

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: 1.7.4

Context
This in AnsiSqlDatabase class, this is the cache:
private async Task<IDictionary<string, string>> GetScriptsRunCache() => _scriptsRunCache ??= await GetAllScriptsRun();
_scriptsRunCache is shared across all migration scripts (Grate scripts and user scripts) which is wrong. user scripts should either "refresh" the cache using the correct table "ScriptsRun" or separate instance of the AnsiSqlDatabase class, or another property to store this (or something else)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions