23 lines
557 B
PHP
23 lines
557 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../../db/config.php';
|
|
|
|
try {
|
|
$db = db();
|
|
$db->exec("
|
|
ALTER TABLE meeting_attendance
|
|
MODIFY COLUMN person_id INT(11) UNSIGNED NOT NULL;
|
|
");
|
|
|
|
$db->exec("
|
|
ALTER TABLE meeting_attendance
|
|
ADD CONSTRAINT fk_person_id FOREIGN KEY (person_id) REFERENCES people(id) ON DELETE CASCADE;
|
|
");
|
|
|
|
echo "Migration 033 run successfully: Changed person_id to UNSIGNED and added foreign key.\n";
|
|
|
|
} catch (PDOException $e) {
|
|
die("Migration 033 failed: " . $e->getMessage() . "\n");
|
|
}
|
|
|