084_channel_billing_model_source.sql 469 B

1234567
  1. -- Add billing_model_source to channels (controls whether billing uses requested or upstream model)
  2. ALTER TABLE channels ADD COLUMN IF NOT EXISTS billing_model_source VARCHAR(20) DEFAULT 'requested';
  3. -- Add channel tracking fields to usage_logs
  4. ALTER TABLE usage_logs ADD COLUMN IF NOT EXISTS channel_id BIGINT;
  5. ALTER TABLE usage_logs ADD COLUMN IF NOT EXISTS model_mapping_chain VARCHAR(500);
  6. ALTER TABLE usage_logs ADD COLUMN IF NOT EXISTS billing_tier VARCHAR(50);