erikbra / grate

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

Scripts in internal Grate migration tables are always registered as "run" #524

Closed erikbra closed 4 months ago

erikbra commented 6 months ago

Describe the bug The internal Grate migration tables always logs all scripts. Might be due to line ending issues when reading from embedded resources, might now

To Reproduce Run a migration, look at the grate.GrateScriptsRun table.

Expected behavior

Screenshots

Desktop (please complete the following information):

Additional context

dgeller-OUHSC commented 6 months ago

@erikbra could that potentially related to a bug we've been seeing intermittently?

`Initializing connections. Running grate v1.7.4 (build date 05/16/2024 01:50:03) against 127.0.0.1 - bam. Looking in database\data for scripts to run.

Setup, Backup, Create/Restore/Drop

================================================================================ Grate Structure

An error occurred: Migration failed due to the following errors: Update ("up"):

grate-internal\02_create_scripts_run_table.sql: Table 'grate_GrateScriptsRun' already exists`

drhamann commented 5 months ago

I reproduce the same issue at the item 544 will follow here if have any news.

erikbra commented 4 months ago

The issue is that the base tables migration is always run in baseline mode (i.e. always registered as run), if the scriptsrun, scriptsrunerrors and version tables already exist (which they do every time, after they are created the first time)