Fix: Add Auto-Migration for 'is_template' column in packing_lists.php to prevent SQL errors on deployment
All checks were successful
Docker Build & Push / build-and-push (push) Successful in 17s

This commit is contained in:
Gemini Agent
2025-12-08 21:28:29 +00:00
parent 8c50910363
commit a19cfa98f0

View File

@@ -15,6 +15,14 @@ require_once 'db_connect.php';
require_once 'header.php';
$current_user_id = $_SESSION['user_id'];
// AUTO-MIGRATION: Check columns to prevent SQL errors
$check_col = $conn->query("SHOW COLUMNS FROM packing_lists LIKE 'is_template'");
if ($check_col && $check_col->num_rows == 0) {
// Add column if missing
$conn->query("ALTER TABLE packing_lists ADD COLUMN is_template TINYINT(1) NOT NULL DEFAULT 0 AFTER share_token");
}
$view = isset($_GET['view']) && $_GET['view'] === 'templates' ? 'templates' : 'lists';
$is_template_view = ($view === 'templates');