summaryrefslogtreecommitdiffhomepage
path: root/packages/cloud/core/src/schema/billing.sql.ts
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-09-18 10:59:01 -0400
committerFrank <[email protected]>2025-09-18 10:59:01 -0400
commit4ceabdffa07b1af8d99eb73622a4d549d99ec6d2 (patch)
tree72e2ae62084a9e24cc76caffbd1f30dafc69ea56 /packages/cloud/core/src/schema/billing.sql.ts
parentc87480cf931a6f8f8b55552558ef521f1918b578 (diff)
downloadopencode-4ceabdffa07b1af8d99eb73622a4d549d99ec6d2.tar.gz
opencode-4ceabdffa07b1af8d99eb73622a4d549d99ec6d2.zip
wip: zen
Diffstat (limited to 'packages/cloud/core/src/schema/billing.sql.ts')
-rw-r--r--packages/cloud/core/src/schema/billing.sql.ts53
1 files changed, 0 insertions, 53 deletions
diff --git a/packages/cloud/core/src/schema/billing.sql.ts b/packages/cloud/core/src/schema/billing.sql.ts
deleted file mode 100644
index 5bec4e900..000000000
--- a/packages/cloud/core/src/schema/billing.sql.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import { bigint, boolean, int, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
-import { timestamps, utc, workspaceColumns } from "../drizzle/types"
-import { workspaceIndexes } from "./workspace.sql"
-
-export const BillingTable = mysqlTable(
- "billing",
- {
- ...workspaceColumns,
- ...timestamps,
- customerID: varchar("customer_id", { length: 255 }),
- paymentMethodID: varchar("payment_method_id", { length: 255 }),
- paymentMethodLast4: varchar("payment_method_last4", { length: 4 }),
- balance: bigint("balance", { mode: "number" }).notNull(),
- monthlyLimit: int("monthly_limit"),
- monthlyUsage: bigint("monthly_usage", { mode: "number" }),
- timeMonthlyUsageUpdated: utc("time_monthly_usage_updated"),
- reload: boolean("reload"),
- reloadError: varchar("reload_error", { length: 255 }),
- timeReloadError: utc("time_reload_error"),
- timeReloadLockedTill: utc("time_reload_locked_till"),
- },
- (table) => [...workspaceIndexes(table), uniqueIndex("global_customer_id").on(table.customerID)],
-)
-
-export const PaymentTable = mysqlTable(
- "payment",
- {
- ...workspaceColumns,
- ...timestamps,
- customerID: varchar("customer_id", { length: 255 }),
- paymentID: varchar("payment_id", { length: 255 }),
- amount: bigint("amount", { mode: "number" }).notNull(),
- },
- (table) => [...workspaceIndexes(table)],
-)
-
-export const UsageTable = mysqlTable(
- "usage",
- {
- ...workspaceColumns,
- ...timestamps,
- model: varchar("model", { length: 255 }).notNull(),
- provider: varchar("provider", { length: 255 }).notNull(),
- inputTokens: int("input_tokens").notNull(),
- outputTokens: int("output_tokens").notNull(),
- reasoningTokens: int("reasoning_tokens"),
- cacheReadTokens: int("cache_read_tokens"),
- cacheWrite5mTokens: int("cache_write_5m_tokens"),
- cacheWrite1hTokens: int("cache_write_1h_tokens"),
- cost: bigint("cost", { mode: "number" }).notNull(),
- },
- (table) => [...workspaceIndexes(table)],
-)