36692-vm/db/migrations/002_create_services_table.php
2025-12-05 19:48:45 +00:00

21 lines
615 B
PHP

<?php
require_once __DIR__ . '/../../db/config.php';
try {
$pdo = db();
$sql = "
CREATE TABLE IF NOT EXISTS services (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10, 2) NOT NULL,
billing_cycle ENUM('monthly', 'yearly') NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
";
$pdo->exec($sql);
echo "Table 'services' created successfully." . PHP_EOL;
} catch (PDOException $e) {
die("Could not create table 'services': " . $e->getMessage());
}