This repository has been archived on 2026-03-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blog-slim.old/src/Database/Migration.php
2026-03-09 16:22:23 +01:00

25 lines
568 B
PHP

<?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
)
");
}
}