mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-27 16:25:50 +00:00
zen: track session in usage
This commit is contained in:
@@ -67,7 +67,7 @@ export const PaymentTable = mysqlTable(
|
||||
timeRefunded: utc("time_refunded"),
|
||||
enrichment: json("enrichment").$type<
|
||||
| {
|
||||
type: "subscription"
|
||||
type: "subscription" | "lite"
|
||||
couponID?: string
|
||||
}
|
||||
| {
|
||||
@@ -93,8 +93,9 @@ export const UsageTable = mysqlTable(
|
||||
cacheWrite1hTokens: int("cache_write_1h_tokens"),
|
||||
cost: bigint("cost", { mode: "number" }).notNull(),
|
||||
keyID: ulid("key_id"),
|
||||
sessionID: varchar("session_id", { length: 30 }),
|
||||
enrichment: json("enrichment").$type<{
|
||||
plan: "sub"
|
||||
plan: "sub" | "byok" | "lite"
|
||||
}>(),
|
||||
},
|
||||
(table) => [...workspaceIndexes(table), index("usage_time_created").on(table.workspaceID, table.timeCreated)],
|
||||
|
||||
Reference in New Issue
Block a user