Skip to content

Commit 9c59bda

Browse files
authored
Fix: Homarr - Manually correct db-migration wrong-folder (#2676)
* Update homarr-install.sh * Update homarr.sh
1 parent 7f4c116 commit 9c59bda

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ct/homarr.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ set +a
4949
export DB_DIALECT='sqlite'
5050
export AUTH_SECRET=$(openssl rand -base64 32)
5151
node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT
52+
for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do
53+
dirname=$(basename "$dir")
54+
mkdir -p "/opt/homarr_db/migrations/$dirname"
55+
cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true
56+
done
5257
export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
5358
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
5459
nginx -g 'daemon off;' &
@@ -97,6 +102,11 @@ set +a
97102
export DB_DIALECT='sqlite'
98103
export AUTH_SECRET=$(openssl rand -base64 32)
99104
node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT
105+
for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do
106+
dirname=$(basename "$dir")
107+
mkdir -p "/opt/homarr_db/migrations/$dirname"
108+
cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true
109+
done
100110
export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
101111
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
102112
nginx -g 'daemon off;' &

install/homarr-install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ set +a
9292
export DB_DIALECT='sqlite'
9393
export AUTH_SECRET=$(openssl rand -base64 32)
9494
node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT
95+
for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do
96+
dirname=$(basename "$dir")
97+
mkdir -p "/opt/homarr_db/migrations/$dirname"
98+
cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true
99+
done
95100
export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
96101
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
97102
nginx -g 'daemon off;' &

0 commit comments

Comments
 (0)