Improved migrations

This commit is contained in:
julien
2026-03-09 17:06:04 +01:00
parent 17ab48abf0
commit ace21bd26c
2 changed files with 10 additions and 2 deletions

View File

@@ -17,7 +17,8 @@
"slim/twig-view": "^3.4",
"catfan/medoo": "2.*",
"vlucas/phpdotenv": "^5.6",
"ezyang/htmlpurifier": "^4.19"
"ezyang/htmlpurifier": "^4.19",
"slim/csrf": "^1.5"
},
"autoload": {
"psr-4": {

View File

@@ -6,9 +6,16 @@ namespace App\Database;
use Medoo\Medoo;
final class Migration
final class Migrator
{
public static function run(Medoo $db): void
{
self::createPostTable($db);
// self::createCommentsTable($db);
// self::createUsersTable($db);
}
private static function createPostTable(Medoo $db): void
{
$db->pdo->exec("
CREATE TABLE IF NOT EXISTS post (