nixos-module: run db migrations on every activation, not just once
The .initial-migration marker file prevented `migrate --force` from ever running again after the first activation, so migrations shipped by a later invoiceninja version upgrade would never apply to an already-deployed instance. `migrate` is idempotent (Laravel tracks applied migrations in the DB), so just run it unconditionally on every activation instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,10 @@ pkgs.testers.nixosTest {
|
||||
|
||||
# phpfpm-invoiceninja/invoiceninja-queue-worker both Require= invoiceninja-data-setup,
|
||||
# so systemd already waited for it to finish above. Confirm the one-time setup steps
|
||||
# it guards actually completed, rather than just that the unit exited.
|
||||
with subtest("one-time setup (migrate, seed, admin account) completed"):
|
||||
machine.succeed("test -f /var/lib/invoiceninja/.initial-migration")
|
||||
# it guards actually completed, rather than just that the unit exited. (Migrations run
|
||||
# unconditionally on every activation rather than being marker-gated, so there's no
|
||||
# marker file to check for them here.)
|
||||
with subtest("one-time setup (seed, admin account) completed"):
|
||||
machine.succeed("test -f /var/lib/invoiceninja/.db-seeded")
|
||||
machine.succeed("test -f /var/lib/invoiceninja/.admin-created")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user