diff --git a/backend/migrations/024_goal_type_registry.sql b/backend/migrations/024_goal_type_registry.sql index 2d40d23..704fc95 100644 --- a/backend/migrations/024_goal_type_registry.sql +++ b/backend/migrations/024_goal_type_registry.sql @@ -36,9 +36,7 @@ CREATE TABLE IF NOT EXISTS goal_type_definitions ( -- Audit created_at TIMESTAMP DEFAULT NOW(), - updated_at TIMESTAMP DEFAULT NOW(), - created_by UUID REFERENCES profiles(id) ON DELETE SET NULL, - updated_by UUID REFERENCES profiles(id) ON DELETE SET NULL + updated_at TIMESTAMP DEFAULT NOW() ); CREATE INDEX IF NOT EXISTS idx_goal_type_definitions_active ON goal_type_definitions(is_active) WHERE is_active = true; diff --git a/backend/routers/goals.py b/backend/routers/goals.py index cce643c..e6a6391 100644 --- a/backend/routers/goals.py +++ b/backend/routers/goals.py @@ -572,16 +572,14 @@ def create_goal_type_definition( INSERT INTO goal_type_definitions ( type_key, label_de, label_en, unit, icon, category, source_table, source_column, aggregation_method, - calculation_formula, description, is_active, is_system, - created_by, updated_by - ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) + calculation_formula, description, is_active, is_system + ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id """, ( data.type_key, data.label_de, data.label_en, data.unit, data.icon, data.category, data.source_table, data.source_column, data.aggregation_method, data.calculation_formula, data.description, - True, False, # is_active=True, is_system=False - pid, pid + True, False # is_active=True, is_system=False )) goal_type_id = cur.fetchone()['id'] @@ -677,8 +675,6 @@ def update_goal_type_definition( raise HTTPException(status_code=400, detail="Keine Änderungen angegeben") updates.append("updated_at = NOW()") - updates.append("updated_by = %s") - params.append(pid) params.append(goal_type_id) cur.execute(