summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/src/schema/billing.sql.ts
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-04 22:46:21 -0500
committerFrank <[email protected]>2026-01-04 22:46:21 -0500
commit9c55cb729bc28c86ca03f0e30e5ff19b4a0a8ea4 (patch)
tree9477f06b571be2b69922a1f7912769133a7fc414 /packages/console/core/src/schema/billing.sql.ts
parentf2e65e40ea55e993cdbccaedb76e79d782175402 (diff)
downloadopencode-9c55cb729bc28c86ca03f0e30e5ff19b4a0a8ea4.tar.gz
opencode-9c55cb729bc28c86ca03f0e30e5ff19b4a0a8ea4.zip
zen: add index
Diffstat (limited to 'packages/console/core/src/schema/billing.sql.ts')
-rw-r--r--packages/console/core/src/schema/billing.sql.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/console/core/src/schema/billing.sql.ts b/packages/console/core/src/schema/billing.sql.ts
index 6d1520d15..17cdd871d 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, int, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
+import { bigint, boolean, index, int, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types"
import { workspaceIndexes } from "./workspace.sql"
@@ -55,5 +55,5 @@ export const UsageTable = mysqlTable(
cost: bigint("cost", { mode: "number" }).notNull(),
keyID: ulid("key_id"),
},
- (table) => [...workspaceIndexes(table)],
+ (table) => [...workspaceIndexes(table), index("usage_time_created").on(table.workspaceID, table.timeCreated)],
)