diff --git a/.manus/db/db-query-1769371508542.json b/.manus/db/db-query-1769371508542.json new file mode 100644 index 0000000..2d98a2b --- /dev/null +++ b/.manus/db/db-query-1769371508542.json @@ -0,0 +1,9 @@ +{ + "query": "ALTER TABLE presences ADD COLUMN IF NOT EXISTS commentaire TEXT;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute ALTER TABLE presences ADD COLUMN IF NOT EXISTS commentaire TEXT;", + "rows": [], + "messages": [], + "stdout": "", + "stderr": "", + "execution_time_ms": 1412 +} \ No newline at end of file diff --git a/server/presenceDb.ts b/server/presenceDb.ts index 9ea0135..602e7a8 100644 --- a/server/presenceDb.ts +++ b/server/presenceDb.ts @@ -1,4 +1,4 @@ -import { eq, and } from "drizzle-orm"; +import { eq, and, sql } from "drizzle-orm"; import { presences, inscriptions, datesFormation, sequences, apprenants } from "../drizzle/schema"; import { getDb } from "./db"; @@ -24,7 +24,7 @@ export async function validerPresence(params: { and( eq(presences.inscriptionId, params.inscriptionId), eq(presences.dateFormationId, params.dateFormationId), - eq(presences.periode, params.periode) + sql`${presences.periode} = ${params.periode}` ) );