hyperhive/scripts/forge-migrate.sh
müde 33f7408ef1 scripts: forge-migrate.sh — run pending DB migrations + restart
for the 'table X has no column Y' class of schema-lag errors that
showed up generating an access token on a fresh 11.0.13 install.
2026-05-17 01:21:40 +02:00

12 lines
435 B
Bash
Executable file

#!/usr/bin/env bash
# Run pending Forgejo DB migrations + restart the daemon.
#
# Use after upgrading the forgejo package, or when a CLI command
# errors with "table X has no column named Y" (schema lag).
set -euo pipefail
sudo nixos-container run hive-forge -- runuser -u forgejo -- \
forgejo --work-path /var/lib/forgejo migrate
sudo nixos-container run hive-forge -- systemctl restart forgejo
echo "forge: migrated + restarted"