Fix: neuigkeiten-Migration auf new Collection()+app.save() umgestellt
importCollections() kompiliert Access-Rules in PocketBase v0.38 nicht korrekt → HTTP 400 bei jedem List-Request. Alle anderen Migrationen (nachrichten, mitglieder, etc.) verwenden new Collection() + app.save() und funktionieren einwandfrei. Gleiche Methode jetzt auch für neuigkeiten und reaktionen. Außerdem: Makefile um staging-reset-Target erweitert (löscht PB-Daten), staging-deploy synchronisiert Migrations und Hooks jetzt vollständig (nicht nur neue Dateien).
This commit is contained in:
parent
ff8e9b2c39
commit
61c430f2e6
2 changed files with 198 additions and 46 deletions
26
Makefile
26
Makefile
|
|
@ -144,7 +144,7 @@ pb-admin:
|
|||
# ==============================================================
|
||||
# STAGING
|
||||
# ==============================================================
|
||||
.PHONY: staging-deploy staging-seed staging-logs staging-status staging-stop
|
||||
.PHONY: staging-deploy staging-reset staging-seed staging-logs staging-status staging-stop
|
||||
|
||||
staging-deploy: check-ssh
|
||||
@echo "→ Sync zu DS (Staging)..."
|
||||
|
|
@ -153,22 +153,18 @@ staging-deploy: check-ssh
|
|||
@if [ -f .env ]; then \
|
||||
cat .env | ssh $(DS_HOST) "cat > $(STAGING_PATH)/.env"; \
|
||||
fi
|
||||
@echo "→ Hooks synchronisieren (Staging)..."
|
||||
@echo "→ Hooks synchronisieren (Staging, vollständig)..."
|
||||
@ssh $(DS_HOST) "mkdir -p $(STAGING_HOOKS)"
|
||||
@if ls $(HOOKS_SRC)/*.pb.js 2>/dev/null | grep -q .; then \
|
||||
for f in $(HOOKS_SRC)/*.pb.js; do \
|
||||
cat "$$f" | ssh $(DS_HOST) "cat > $(STAGING_HOOKS)/$$(basename $$f)"; \
|
||||
done; \
|
||||
fi
|
||||
@echo "→ Migrations synchronisieren (Staging, nur neue)..."
|
||||
@echo "→ Migrations synchronisieren (Staging, immer aktuell)..."
|
||||
@ssh $(DS_HOST) "mkdir -p $(STAGING_MIGRATIONS)"
|
||||
@if ls $(MIGRATIONS_SRC)/*.js 2>/dev/null | grep -q .; then \
|
||||
for f in $(MIGRATIONS_SRC)/*.js; do \
|
||||
fname=$$(basename "$$f"); \
|
||||
if ! ssh $(DS_HOST) "test -f $(STAGING_MIGRATIONS)/$$fname" 2>/dev/null; then \
|
||||
cat "$$f" | ssh $(DS_HOST) "cat > $(STAGING_MIGRATIONS)/$$fname"; \
|
||||
echo " ✓ $$fname"; \
|
||||
fi; \
|
||||
cat "$$f" | ssh $(DS_HOST) "cat > $(STAGING_MIGRATIONS)/$$(basename $$f)"; \
|
||||
done; \
|
||||
fi
|
||||
@echo "→ Docker rebuild + restart (Staging)..."
|
||||
|
|
@ -181,6 +177,20 @@ staging-deploy: check-ssh
|
|||
@echo " App: https://staging.vereins.haus"
|
||||
@echo " PocketBase: https://api-staging.vereins.haus/_/"
|
||||
|
||||
# Löscht alle PB-Daten auf Staging → Migrations laufen frisch durch
|
||||
# Danach: make staging-deploy && make staging-seed
|
||||
staging-reset: check-ssh staging-stop
|
||||
@echo "→ PocketBase-Daten auf Staging löschen..."
|
||||
@ssh $(DS_HOST) "rm -rf \
|
||||
$(STAGING_PATH)/pocketbase/data/storage \
|
||||
'$(STAGING_PATH)/pocketbase/data/data.db' \
|
||||
'$(STAGING_PATH)/pocketbase/data/data.db-wal' \
|
||||
'$(STAGING_PATH)/pocketbase/data/data.db-shm' \
|
||||
$(STAGING_PATH)/pocketbase/migrations"
|
||||
@echo "→ Alle Hooks auf Staging löschen (werden via staging-deploy neu geschrieben)..."
|
||||
@ssh $(DS_HOST) "rm -f $(STAGING_HOOKS)/*.pb.js"
|
||||
@echo " ✓ Reset fertig. Jetzt: make staging-deploy && make staging-seed"
|
||||
|
||||
staging-seed:
|
||||
@echo "→ Testdaten in Staging einfügen..."
|
||||
@echo " Voraussetzung: PB_EMAIL + PB_PASSWORD in .env gesetzt (Staging-Superuser)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue