Grundgerüst für Certain Finance: - Backend: FastAPI + SQLAlchemy + SQLite, Alembic-Migrationen (Batch-Mode), argon2-Passwort-Hashing, server-seitige Sitzungen im Cookie, Erst-Admin, Benutzerverwaltung mit Temporär-Passwort, Einstellungen je Benutzer. - Ein Prozess, ein Port: uvicorn liefert API (/api) und gebautes SPA aus, inkl. SPA-Deeplink-Fallback. - Frontend: React 18 + Vite + JSX, Design-Tokens (Light/Dark), i18n DE/EN, Inline-SVG-Icons (keine Emojis), Login, Passwort-ändern, Dashboard-Platzhalter, Benutzer- und Einstellungsseiten. - Deploy: nativer LXC-Installer + Update-Skript (systemd), env-Vorlage, Doku. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
737 B
Python
26 lines
737 B
Python
"""Programmatisches Anwenden der Alembic-Migrationen.
|
||
|
||
Wird beim App-Start aufgerufen, damit ein frisch geklontes/gestartetes System
|
||
sofort das aktuelle Schema hat – ohne dass man ``alembic`` von Hand ausführen muss.
|
||
Das Install-/Update-Skript ruft ``alembic upgrade head`` zusätzlich auf; das ist
|
||
idempotent.
|
||
"""
|
||
|
||
from pathlib import Path
|
||
|
||
from alembic import command
|
||
from alembic.config import Config
|
||
|
||
# backend/ (eine Ebene über app/)
|
||
BACKEND_DIR = Path(__file__).resolve().parent.parent
|
||
|
||
|
||
def _config() -> Config:
|
||
cfg = Config(str(BACKEND_DIR / "alembic.ini"))
|
||
cfg.set_main_option("script_location", str(BACKEND_DIR / "migrations"))
|
||
return cfg
|
||
|
||
|
||
def upgrade_to_head() -> None:
|
||
command.upgrade(_config(), "head")
|