Progressionsgraph verbessert #54

Merged
Lars merged 30 commits from develop into main 2026-06-09 16:37:22 +02:00
4 changed files with 47 additions and 7 deletions
Showing only changes of commit 7db77f4738 - Show all commits

View File

@ -18,6 +18,11 @@ jobs:
docker compose -f docker-compose.dev-env.yml build --no-cache docker compose -f docker-compose.dev-env.yml build --no-cache
docker compose -f docker-compose.dev-env.yml up -d docker compose -f docker-compose.dev-env.yml up -d
sleep 5 sleep 5
curl -sf http://localhost:8098/api/version && echo "✓ DEV API healthy" if ! curl -sf http://localhost:8098/api/version; then
echo "✗ DEV API nicht erreichbar — Backend-Logs (Migration/Startup):"
docker compose -f docker-compose.dev-env.yml logs backend --tail 120 || true
exit 1
fi
echo "✓ DEV API healthy"
curl -sf http://localhost:3098/api/version && echo "✓ DEV über Frontend-Nginx (wie Browser) healthy" curl -sf http://localhost:3098/api/version && echo "✓ DEV über Frontend-Nginx (wie Browser) healthy"
echo "=== Shinkan DEV Deploy complete ===" echo "=== Shinkan DEV Deploy complete ==="

View File

@ -11,9 +11,8 @@ on:
jobs: jobs:
# Pytest im laufenden backend-Container; ACCESS_LAYER + TRAINING_PLANNING Integration gegen dieselbe PostgreSQL wie Deploy (Schema via Container-Start migriert). # Pytest im laufenden backend-Container; ACCESS_LAYER + TRAINING_PLANNING Integration gegen dieselbe PostgreSQL wie Deploy (Schema via Container-Start migriert).
# Nicht bei push auf develop/main: Deploy läuft parallel → Container oft im Restart (siehe workflow_run nach Deploy).
pytest-backend: pytest-backend:
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'pull_request' }} if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Backend pytest im deployten Container - name: Backend pytest im deployten Container

View File

@ -15,8 +15,16 @@ BEGIN
SELECT 1 FROM information_schema.columns SELECT 1 FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'features' AND column_name = 'limit_type' WHERE table_schema = 'public' AND table_name = 'features' AND column_name = 'limit_type'
) THEN ) THEN
-- Nach abgebrochenem Erstversuch kann features_legacy_001 schon existieren
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_schema = 'public' AND table_name = 'features_legacy_001'
) THEN
DROP TABLE features;
ELSE
ALTER TABLE features RENAME TO features_legacy_001; ALTER TABLE features RENAME TO features_legacy_001;
END IF; END IF;
END IF;
IF EXISTS ( IF EXISTS (
SELECT 1 FROM information_schema.tables SELECT 1 FROM information_schema.tables
@ -25,8 +33,15 @@ BEGIN
SELECT 1 FROM information_schema.columns SELECT 1 FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'tier_limits' AND column_name = 'tier' WHERE table_schema = 'public' AND table_name = 'tier_limits' AND column_name = 'tier'
) THEN ) THEN
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_schema = 'public' AND table_name = 'tier_limits_legacy_001'
) THEN
DROP TABLE tier_limits;
ELSE
ALTER TABLE tier_limits RENAME TO tier_limits_legacy_001; ALTER TABLE tier_limits RENAME TO tier_limits_legacy_001;
END IF; END IF;
END IF;
IF EXISTS ( IF EXISTS (
SELECT 1 FROM information_schema.tables SELECT 1 FROM information_schema.tables
@ -35,8 +50,15 @@ BEGIN
SELECT 1 FROM information_schema.columns SELECT 1 FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'user_feature_usage' AND column_name = 'profile_id' WHERE table_schema = 'public' AND table_name = 'user_feature_usage' AND column_name = 'profile_id'
) THEN ) THEN
IF EXISTS (
SELECT 1 FROM information_schema.tables
WHERE table_schema = 'public' AND table_name = 'user_feature_usage_legacy_001'
) THEN
DROP TABLE user_feature_usage;
ELSE
ALTER TABLE user_feature_usage RENAME TO user_feature_usage_legacy_001; ALTER TABLE user_feature_usage RENAME TO user_feature_usage_legacy_001;
END IF; END IF;
END IF;
END END
$migration$; $migration$;

View File

@ -1,5 +1,19 @@
-- Migration 079: Capability-Registry + Rollen-Grants (M3 / CAPABILITY_CATALOG.v1.md C1) -- Migration 079: Capability-Registry + Rollen-Grants (M3 / CAPABILITY_CATALOG.v1.md C1)
-- Account-Gates und Enforcement in Python (account_lifecycle.py, capabilities.py). -- Account-Gates und Enforcement in Python (account_lifecycle.py, capabilities.py).
-- Voraussetzung: Migration 078 (features.id TEXT). Kein FK auf features — vermeidet
-- Startup-Abbruch wenn 078 noch aussteht oder features-Schema driftet (001 vs v9c).
DO $migration$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'features' AND column_name = 'limit_type'
) THEN
RAISE EXCEPTION
'Migration 079: features-Tabelle nicht v9c (limit_type fehlt). Zuerst 078_club_features_and_plans anwenden.';
END IF;
END
$migration$;
CREATE TABLE IF NOT EXISTS capabilities ( CREATE TABLE IF NOT EXISTS capabilities (
id TEXT PRIMARY KEY, id TEXT PRIMARY KEY,
@ -10,7 +24,7 @@ CREATE TABLE IF NOT EXISTS capabilities (
CHECK (min_account_state IN ( CHECK (min_account_state IN (
'unverified', 'verified_pending_club', 'active_member', 'platform_admin' 'unverified', 'verified_pending_club', 'active_member', 'platform_admin'
)), )),
linked_feature_id TEXT REFERENCES features(id) ON DELETE SET NULL, linked_feature_id TEXT,
active BOOLEAN NOT NULL DEFAULT true, active BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()