added migration
Build and publish Docker image / build (push) Failing after 41s

This commit is contained in:
NikoKS committed 2026-10-15 00:05:11 +07:00
1 parent 125eab3cd4
commit 045d3a8fd3
8 files changed
+375 -65

No files matched your search

+6 -1
View File
@@ -26,8 +26,13 @@ try {
} while ($conn->more_results() && $conn->next_result());
fwrite(STDOUT, "Applied: $file\n");
}
// Fail the one-shot service before starting Apache if setup is incomplete.
foreach (['rec_admin', 'rec_exam_attempt', 'rec_exam_event', 'rec_candidate_login_guard'] as $table) {
$conn->query("SELECT 1 FROM `$table` LIMIT 0");
}
$conn->query('SELECT email, nama_de, nama_be, idkar, password_hash FROM rec_admin LIMIT 0');
fwrite(STDOUT, "Database ready. Existing accounts and test data were preserved.\n");
} catch (Throwable $error) {
fwrite(STDERR, 'Migration failed: ' . $error->getMessage() . "\nImport the base database first; see docs/deployment.md.\n");
fwrite(STDERR, 'Migration failed: ' . $error->getMessage() . "\nReview setup logs and docs/deployment.md before retrying.\n");
exit(1);
}