zen: add index
parent
f2e65e40ea
commit
9c55cb729b
|
|
@ -0,0 +1 @@
|
|||
CREATE INDEX `usage_time_created` ON `usage` (`workspace_id`,`time_created`);
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -281,6 +281,13 @@
|
|||
"when": 1766946179892,
|
||||
"tag": "0039_striped_forge",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 40,
|
||||
"version": "5",
|
||||
"when": 1767584617316,
|
||||
"tag": "0040_broken_gamora",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -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)],
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue