21 lines
664 B
PHP
21 lines
664 B
PHP
|
|
<?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();
|
||
|
|
}
|
||
|
|
?>
|