summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/src/schema/billing.sql.ts
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-06 19:40:36 -0500
committerFrank <[email protected]>2026-01-06 23:34:12 -0500
commit22b058a33d40f0bdf1052fcc542b75f67f738fc6 (patch)
treeb153d80b5cdba27339006a13edd10812c7108067 /packages/console/core/src/schema/billing.sql.ts
parent939c0940aaeede94fd9a2af07a47ecda25426b2e (diff)
downloadopencode-22b058a33d40f0bdf1052fcc542b75f67f738fc6.tar.gz
opencode-22b058a33d40f0bdf1052fcc542b75f67f738fc6.zip
wip: black
Diffstat (limited to 'packages/console/core/src/schema/billing.sql.ts')
-rw-r--r--packages/console/core/src/schema/billing.sql.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/console/core/src/schema/billing.sql.ts b/packages/console/core/src/schema/billing.sql.ts
index 17cdd871d..52de18f64 100644
--- a/packages/console/core/src/schema/billing.sql.ts
+++ b/packages/console/core/src/schema/billing.sql.ts
@@ -1,4 +1,4 @@
-import { bigint, boolean, index, int, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
+import { bigint, boolean, index, int, json, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types"
import { workspaceIndexes } from "./workspace.sql"
@@ -21,6 +21,7 @@ export const BillingTable = mysqlTable(
reloadError: varchar("reload_error", { length: 255 }),
timeReloadError: utc("time_reload_error"),
timeReloadLockedTill: utc("time_reload_locked_till"),
+ subscriptionID: varchar("subscription_id", { length: 28 }),
},
(table) => [...workspaceIndexes(table), uniqueIndex("global_customer_id").on(table.customerID)],
)
@@ -54,6 +55,9 @@ export const UsageTable = mysqlTable(
cacheWrite1hTokens: int("cache_write_1h_tokens"),
cost: bigint("cost", { mode: "number" }).notNull(),
keyID: ulid("key_id"),
+ enrichment: json("data").$type<{
+ plan: "sub"
+ }>(),
},
(table) => [...workspaceIndexes(table), index("usage_time_created").on(table.workspaceID, table.timeCreated)],
)