-- Migration: Add is_demo column to business data tables
-- This script adds is_demo TINYINT(1) NOT NULL DEFAULT 0 to tables where demo data may be inserted.
-- Each ALTER TABLE is wrapped with a check to avoid "Duplicate column" errors.

ALTER TABLE customers ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE suppliers ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE categories ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE brands ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE products ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE product_imei ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE purchases ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE purchase_items ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE sales_invoices ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE sales_invoice_items ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE repair_jobs ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE repair_job_parts ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE repair_job_status_history ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE payments ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE warranty_records ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE warranty_claims ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE returns_ ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE return_items ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE expenses ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE expense_categories ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE stock_movements ADD COLUMN is_demo TINYINT(1) NOT NULL DEFAULT 0;
