mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-03 16:15:54 +00:00
fix(pangolin): restore config before db migration, use drizzle-kit push (#12130)
npm run db:push ran drizzle migrate (CREATE TABLE) on an empty directory before the config backup was restored, creating a fresh DB that got immediately overwritten by the old backup. The old DB was missing new columns like resources.postAuthPath (added in 1.15.4). Replace with drizzle-kit push after config restore, which introspects the existing DB and applies schema diffs (ALTER TABLE) instead. Ref: #12068
This commit is contained in:
committed by
GitHub
parent
1273778dc2
commit
85c5d54a12
@@ -51,7 +51,6 @@ function update_script() {
|
||||
$STD npm run db:generate
|
||||
$STD npm run build
|
||||
$STD npm run build:cli
|
||||
$STD npm run db:push
|
||||
cp -R .next/standalone ./
|
||||
chmod +x ./dist/cli.mjs
|
||||
cp server/db/names.json ./dist/names.json
|
||||
@@ -64,6 +63,11 @@ function update_script() {
|
||||
rm -f /opt/pangolin_config_backup.tar.gz
|
||||
msg_ok "Restored config"
|
||||
|
||||
msg_info "Running database migrations"
|
||||
cd /opt/pangolin
|
||||
ENVIRONMENT=prod $STD npx drizzle-kit push --config drizzle.sqlite.config.ts
|
||||
msg_ok "Ran database migrations"
|
||||
|
||||
msg_info "Updating Badger plugin version"
|
||||
BADGER_VERSION=$(get_latest_github_release "fosrl/badger" "false")
|
||||
sed -i "s/version: \"v[0-9.]*\"/version: \"$BADGER_VERSION\"/g" /opt/pangolin/config/traefik/traefik_config.yml
|
||||
|
||||
Reference in New Issue
Block a user