-- Adds missing columns to track operations and table sessions
ALTER TABLE restaurant_tables
ADD COLUMN session_id VARCHAR(255) DEFAULT NULL COMMENT 'Tracks the specific session of the table usage',
ADD COLUMN seated_at DATETIME DEFAULT NULL COMMENT 'Tracks when the table became occupied';

-- Adds columns for split table tracking (run once)
ALTER TABLE restaurant_tables
ADD COLUMN IF NOT EXISTS split_parent_id INT DEFAULT NULL COMMENT 'References the original parent table ID when this is a virtual split table',
ADD COLUMN IF NOT EXISTS has_active_splits TINYINT(1) DEFAULT FALSE COMMENT 'TRUE when this table has been split and its virtual children are still active';

