erikbra / grate

grate - the SQL scripts migration runner
MIT License
209 stars 40 forks source link

Baseline creates orphan version_id in ScriptsRun #553

Closed bhorn closed 4 months ago

bhorn commented 4 months ago

When running baseline (SQL Server), while 'in progress' there is a new version in the grate.Version table, but on completion this has vanished, and the grate.ScriptsRun table is left with a set of entries with a non-existent version_id.

The version_id is then reused on the next grate run, so ScriptsRun ends up mixing Baseline and Update1 into one version_id, which is a bit confusing.

RW-RuneAnkerroLiljegren commented 4 months ago

That aligns with what i have observed, but maybe i have not understood what the baseline actually does? I assume that I would get a version row inside my grate.Version when using --baseline, is that understood correctly and there is an issue here?