summaryrefslogtreecommitdiffhomepage
path: root/cloud/core/src/schema
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-09-15 14:48:00 -0400
committerFrank <[email protected]>2025-09-15 14:48:02 -0400
commit5e6dd312eb9e4883b43fe9e61f9df7677e880812 (patch)
tree429d5eae2a4aca9af94b2e44ded090794e9dd693 /cloud/core/src/schema
parent7218a662ab08e5526d469090a565342872f04a48 (diff)
downloadopencode-5e6dd312eb9e4883b43fe9e61f9df7677e880812.tar.gz
opencode-5e6dd312eb9e4883b43fe9e61f9df7677e880812.zip
wip: zen
Diffstat (limited to 'cloud/core/src/schema')
-rw-r--r--cloud/core/src/schema/billing.sql.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/cloud/core/src/schema/billing.sql.ts b/cloud/core/src/schema/billing.sql.ts
index 7d73b922c..5bec4e900 100644
--- a/cloud/core/src/schema/billing.sql.ts
+++ b/cloud/core/src/schema/billing.sql.ts
@@ -1,5 +1,5 @@
-import { bigint, boolean, int, mysqlTable, varchar, json } from "drizzle-orm/mysql-core"
-import { timestamps, workspaceColumns } from "../drizzle/types"
+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(
@@ -11,9 +11,15 @@ export const BillingTable = mysqlTable(
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)],
+ (table) => [...workspaceIndexes(table), uniqueIndex("global_customer_id").on(table.customerID)],
)
export const PaymentTable = mysqlTable(