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.
This commit is contained in:
parent
a1c4d37bc9
commit
33f7408ef1
1 changed files with 12 additions and 0 deletions
12
scripts/forge-migrate.sh
Executable file
12
scripts/forge-migrate.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/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"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue