Add MySQL schema dump for phpMyAdmin
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use PDO;
|
||||
|
||||
return function (PDO $pdo): void {
|
||||
$pdo->exec(<<<SQL
|
||||
CREATE TABLE attachments (
|
||||
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
comment_id INT UNSIGNED NOT NULL,
|
||||
filename VARCHAR(255) NOT NULL,
|
||||
path VARCHAR(255) NOT NULL,
|
||||
size INT UNSIGNED NOT NULL,
|
||||
mime VARCHAR(255) NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT fk_attachments_comment FOREIGN KEY (comment_id) REFERENCES comments(id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
SQL);
|
||||
};
|
||||
Reference in New Issue
Block a user