diff --git a/public/index.php b/public/index.php index 874588e..6efd9e9 100644 --- a/public/index.php +++ b/public/index.php @@ -60,6 +60,17 @@ if (!isset($medooOptions['database_name'])) { } $database = new Medoo($medooOptions); +// Créer la table si nécessaire (schéma minimal) +$database->query( + <<<'SQL' +CREATE TABLE IF NOT EXISTS post ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + title TEXT NOT NULL, + content TEXT NOT NULL +); +SQL +); + // ------------------------- // Services (container simple) // ------------------------- diff --git a/scripts/migrations.php b/scripts/migrations.php deleted file mode 100644 index c213412..0000000 --- a/scripts/migrations.php +++ /dev/null @@ -1,34 +0,0 @@ - 'sqlite', - 'database_file' => $dbFile, -]); - -// schéma minimal — CREATE TABLE IF NOT EXISTS est idempotent -$database->query( - <<<'SQL' -CREATE TABLE IF NOT EXISTS post ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - title TEXT NOT NULL, - content TEXT NOT NULL -); -SQL -); - -echo "Migrations applied (minimal).\n";