DB Migration: social_content fehlende Spalten (coaching, media_url, category, exercise_id)

This commit is contained in:
rene 2026-04-24 20:35:00 +02:00
parent 548210b908
commit 75615140c4

View file

@ -524,6 +524,10 @@ def _migrate(conn_factory):
("users", "last_activity_date","TEXT"),
# Social Media Manager
("users", "is_social_media", "INTEGER NOT NULL DEFAULT 0"),
("social_content", "coaching", "TEXT"),
("social_content", "media_url", "TEXT"),
("social_content", "category", "TEXT"),
("social_content", "exercise_id", "TEXT"),
]
with conn_factory() as conn:
for table, column, col_type in migrations:
@ -590,6 +594,27 @@ def _migrate(conn_factory):
ON training_exercises(kategorie);
""")
# Pflege-Tipps (für Social Media + User-spezifisch)
conn.executescript("""
CREATE TABLE IF NOT EXISTS pflege_tipps (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tipp_id TEXT NOT NULL UNIQUE,
titel TEXT NOT NULL,
kategorie TEXT NOT NULL,
beschreibung TEXT,
schritte TEXT,
materialien TEXT,
haeufigkeit TEXT,
fell_typ TEXT,
saison TEXT,
rassengruppe TEXT,
tipp TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);
CREATE INDEX IF NOT EXISTS idx_pflege_tipps_kat
ON pflege_tipps(kategorie);
""")
# Knigge: Community-Votes
conn.executescript("""
CREATE TABLE IF NOT EXISTS knigge_votes (