37338-vm/db/migrations/031_create_meeting_attendance_table.php
2026-01-11 12:14:53 +00:00

27 lines
806 B
PHP

<?php
require_once __DIR__ . '/../../db/config.php';
try {
$db = db();
// Create meeting_attendance table
$db->exec("
CREATE TABLE IF NOT EXISTS meeting_attendance (
id INT AUTO_INCREMENT PRIMARY KEY,
meeting_id INT NOT NULL,
person_id INT NOT NULL,
attendance_status ENUM('present', 'absent', 'substitute', 'n/a') NOT NULL DEFAULT 'n/a',
guest_survey ENUM('1', '2', '3'),
updated_by INT,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY (meeting_id, person_id)
)
");
echo "Migration 031 run successfully: meeting_attendance table created.
";
} catch (PDOException $e) {
die("Migration 031 failed: " . $e->getMessage() . "
");
}