mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
- Warn at startup when quest files are missing (clients crash without them) and point users to the download link - Fix Host config description: it's the advertised IP, not a bind address — 0.0.0.0 was wrong advice - Load bundled schemas (shops, events, gacha) in Docker init so new users get working demo data out of the box - Renumber duplicate patch schema 28 → 32 to resolve numbering collision - Fix patch schema example filename to use hyphens matching actual files
27 lines
920 B
Bash
27 lines
920 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "INIT: Restoring database schema..."
|
|
pg_restore --username="$POSTGRES_USER" --dbname="$POSTGRES_DB" --no-owner --no-acl --verbose /schemas/init.sql || {
|
|
echo "WARN: pg_restore exited with errors (this is expected if the database already has objects)"
|
|
}
|
|
|
|
echo "Updating!"
|
|
for file in /schemas/update-schema/*; do
|
|
echo " Applying $file"
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f "$file"
|
|
done
|
|
|
|
echo "Patching!"
|
|
for file in /schemas/patch-schema/*; do
|
|
[ -f "$file" ] || continue
|
|
echo " Applying $file"
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f "$file"
|
|
done
|
|
|
|
echo "Loading bundled data (shops, events, gacha)..."
|
|
for file in /schemas/bundled-schema/*; do
|
|
[ -f "$file" ] || continue
|
|
echo " Applying $file"
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f "$file"
|
|
done |