35644-vm/db/migrations/001_create_restaurants_table.php
Flatlogic Bot 23725f3016 gmaps
2025-11-11 12:38:11 +00:00

21 lines
553 B
PHP

<?php
require_once __DIR__ . '/../config.php';
try {
$pdo = db();
$sql = "
CREATE TABLE IF NOT EXISTS restaurants (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
latitude DECIMAL(10, 8) NOT NULL,
longitude DECIMAL(11, 8) NOT NULL,
description TEXT
);
";
$pdo->exec($sql);
echo "Migration successful: 'restaurants' table created or already exists.\n";
} catch (PDOException $e) {
die("Migration failed: " . $e->getMessage() . "\n");
}