Added migration file

This commit is contained in:
julien
2026-03-09 16:22:23 +01:00
parent 03ce72ce00
commit 888096996a
5 changed files with 83 additions and 33 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace App\Database;
use Medoo\Medoo;
final class Migration
{
public static function run(Medoo $db): void
{
$db->pdo->exec("
CREATE TABLE IF NOT EXISTS post (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
content TEXT NOT NULL,
slug TEXT UNIQUE NOT NULL DEFAULT '',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
)
");
}
}