llmage/sql/drop_cost_add_tenantid.sql
yumoqing cf16d60893 refactor: drop cost from llmusage, add tenantid, clean references
- Remove cost field from llm_charging, get_accounting_llmusages, backup, syncinference
- Add tenantid column migration SQL
2026-07-07 12:23:51 +08:00

7 lines
436 B
SQL

-- DROP cost column, ADD tenantid column to llmusage
ALTER TABLE llmusage DROP COLUMN IF EXISTS cost;
ALTER TABLE llmusage ADD COLUMN IF NOT EXISTS tenantid VARCHAR(32) DEFAULT NULL COMMENT '租户orgid,标识客户在哪个分销商入口消费';
-- Also update llmusage_history if exists
ALTER TABLE llmusage_history DROP COLUMN IF EXISTS cost;
ALTER TABLE llmusage_history ADD COLUMN IF NOT EXISTS tenantid VARCHAR(32) DEFAULT NULL;