36766-vm/db/migration_001_warranty.php
Flatlogic Bot 6c14b2436f 2.0
2025-12-18 09:40:37 +00:00

19 lines
553 B
PHP

<?php
require_once __DIR__ . '/config.php';
try {
$pdo = db();
$sql = "
CREATE TABLE IF NOT EXISTS warranty_registrations (
id INT AUTO_INCREMENT PRIMARY KEY,
serial_number VARCHAR(255) NOT NULL,
customer_name VARCHAR(255) NOT NULL,
installation_date DATE NOT NULL,
registration_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);";
$pdo->exec($sql);
echo "Table 'warranty_registrations' created successfully." . PHP_EOL;
} catch (PDOException $e) {
die("DB ERROR: " . $e->getMessage());
}
?>