Files
sam-sales/sales_scenario/setup_db.php

21 lines
664 B
PHP
Raw Permalink Normal View History

2025-12-17 12:59:26 +09:00
<?php
include '../lib/mydb.php';
try {
$pdo = db_connect();
$sql = "CREATE TABLE IF NOT EXISTS sales_scenario_checklist (
id INT AUTO_INCREMENT PRIMARY KEY,
tenant_id VARCHAR(50) NOT NULL,
step_id INT NOT NULL,
checkpoint_index INT NOT NULL,
is_checked BOOLEAN DEFAULT FALSE,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY unique_check (tenant_id, step_id, checkpoint_index)
)";
$pdo->exec($sql);
echo "Table 'sales_scenario_checklist' created successfully.";
} catch (PDOException $e) {
echo "Error creating table: " . $e->getMessage();
}
?>