Skip to content

fix: run migrations on container start only - #130

Merged
nzxl101 merged 1 commit into
Notifiarr:developfrom
Joly0:fix/migrations-at-startup
Nov 10, 2026
Merged

nzxl101 merged 1 commit into
Notifiarr:developfrom
Joly0:fix/migrations-at-startup

Conversation

@Joly0

@Joly0 Joly0 commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

As discussed in #121: loader.php only ran $proxyDb->migrations() for UI requests, so container startup never ran them and every UI request did, creating and deleting migration-in-progress.txt and writing two lines to app.log each time.

  • startup.php defines IS_STARTUP before loading loader.php, and migrations only run when it is set (the crons also load loader.php from the CLI, so a CLI check would not work)
  • On startup, a leftover migration-in-progress.txt is deleted before migrating. Nothing else runs that early, so it can only be from a start that died mid migration, and it would otherwise block migrations for good

Tested:

  • Empty /config: database created and migrations 001 to 008 applied at startup, no lock file left
  • Copy of an existing database with a stale lock file: lock cleared, migrations ran once at startup
  • UI and ajax requests no longer write the migration lines to app.log; with feat: auto-refresh the log viewer #121, sse.php polls add nothing to app.log

The UI ran migrations on every request, writing the lock file and two app.log lines each time, while startup never ran them. Clear a stale lock left by an interrupted start.
@nzxl101
nzxl101 merged commit d44c80d into Notifiarr:develop Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants