Add MySQL schema dump for phpMyAdmin

This commit is contained in:
Thomas
2025-10-28 14:08:03 +01:00
parent f956a735ca
commit 8e608d03ec
49 changed files with 1929 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
<?php
use PDO;
return function (PDO $pdo): void {
$pdo->exec(<<<SQL
CREATE TABLE comments (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
issue_id INT UNSIGNED NOT NULL,
user_id INT UNSIGNED NOT NULL,
body TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT fk_comments_issue FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE,
CONSTRAINT fk_comments_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
INDEX idx_comments_issue_created (issue_id, created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
SQL);
};