migration to mysql
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-07-10 09:57:44 +02:00
parent 351af170a0
commit 810ed24792
24 changed files with 986 additions and 208 deletions

View File

@ -104,10 +104,14 @@ function qdb_save_structure_snapshot(PDO $pdo, string $qnID, int $revision, arra
}
$pdo->prepare(
'INSERT INTO questionnaire_structure_snapshot (questionnaireID, structureRevision, createdAt, manifestJson)
VALUES (:qn, :rev, :ts, :mj)
ON CONFLICT(questionnaireID, structureRevision) DO UPDATE SET
manifestJson = excluded.manifestJson,
createdAt = excluded.createdAt'
VALUES (:qn, :rev, :ts, :mj) '
. qdb_upsert_update(
['questionnaireID', 'structureRevision'],
[
'manifestJson' => 'excluded.manifestJson',
'createdAt' => 'excluded.createdAt',
]
)
)->execute([
':qn' => $qnID,
':rev' => $revision,
@ -168,10 +172,7 @@ function qdb_option_has_client_data(PDO $pdo, string $answerOptionID): bool {
if ($stmt->fetchColumn()) {
return true;
}
$chk = $pdo->query(
"SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'client_answer_submission' LIMIT 1"
);
if (!$chk || !$chk->fetchColumn()) {
if (!qdb_table_exists($pdo, 'client_answer_submission')) {
return false;
}
$stmt = $pdo->prepare(
@ -187,10 +188,7 @@ function qdb_question_has_client_data(PDO $pdo, string $questionID): bool {
if ($stmt->fetchColumn()) {
return true;
}
$chk = $pdo->query(
"SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'client_answer_submission' LIMIT 1"
);
if (!$chk || !$chk->fetchColumn()) {
if (!qdb_table_exists($pdo, 'client_answer_submission')) {
return false;
}
$stmt = $pdo->prepare(