-- Migration: Add billing_method to tmodule_times
-- Date: 2025-02-02
-- Description: Adds detailed billing method to replace simple boolean, aligning with tticket_worklog

ALTER TABLE tmodule_times 
ADD COLUMN IF NOT EXISTS billing_method VARCHAR(50) DEFAULT 'invoice';

-- Migrate existing data
UPDATE tmodule_times SET billing_method = 'internal' WHERE billable = false;
UPDATE tmodule_times SET billing_method = 'invoice' WHERE billable = true;
