dev #4

Merged
nessi merged 25 commits from dev into main 2026-02-06 13:36:47 +00:00
2 changed files with 23 additions and 7 deletions
Showing only changes of commit 4a012b7345 - Show all commits

View File

@@ -40,22 +40,33 @@ def _rand_join_code(n: int = 6) -> str:
def _has_column(db: Session, table: str, col: str) -> bool:
"""
SQLite + Postgres friendly check.
We use a pragma first (SQLite), fallback to information_schema.
Postgres + SQLite friendly check without spamming Postgres logs.
- SQLite: PRAGMA table_info
- Postgres: information_schema
"""
dialect = None
try:
dialect = db.get_bind().dialect.name # "postgresql" | "sqlite" | ...
except Exception:
dialect = None
if dialect == "sqlite":
try:
rows = db.execute(text(f"PRAGMA table_info({table})")).all()
return any(r[1] == col for r in rows) # pragma: column name is at index 1
return any(r[1] == col for r in rows)
except Exception:
db.rollback()
return False
# default: Postgres (or others) via information_schema
try:
rows = db.execute(
text(
"""
SELECT column_name
SELECT 1
FROM information_schema.columns
WHERE table_name = :t AND column_name = :c
LIMIT 1
"""
),
{"t": table, "c": col},
@@ -66,6 +77,7 @@ WHERE table_name = :t AND column_name = :c
return False
def _auto_migrate(db: Session):
"""
Very small, pragmatic auto-migration (no alembic).

View File

@@ -16,6 +16,8 @@ export const styles = {
},
topBar: {
position: "relative",
zIndex: 50,
display: "flex",
justifyContent: "space-between",
alignItems: "center",
@@ -153,6 +155,8 @@ export const styles = {
// Admin
adminWrap: {
position: "relative",
zIndex: 1,
marginTop: 14,
padding: 12,
borderRadius: 16,
@@ -471,7 +475,7 @@ export const styles = {
background: "linear-gradient(180deg, rgba(20,20,24,0.96), rgba(12,12,14,0.92))",
boxShadow: "0 18px 55px rgba(0,0,0,0.70)",
overflow: "hidden",
zIndex: 10000,
zIndex: 99999,
backdropFilter: "blur(8px)",
},