Skip to content

Commit

Permalink
perf: add database indices
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Oct 4, 2024
1 parent bfcb46d commit 6bcc69b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/db/src/schema/audit_logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export const auditLog = mysqlTable(
},
(table) => ({
workspaceId: index("workspace_id_idx").on(table.workspaceId),
bucketId: index("bucket_id_idx").on(table.bucketId),
event: index("event_idx").on(table.event),
actorId: index("actor_id_idx").on(table.actorId),
time: index("time_idx").on(table.time),
}),
);

Expand Down Expand Up @@ -115,6 +119,7 @@ export const auditLogTarget = mysqlTable(
},
(table) => ({
pk: primaryKey({ columns: [table.auditLogId, table.id] }),
auditLog: index("audit_log_id").on(table.auditLogId),
}),
);

Expand Down

0 comments on commit 6bcc69b

Please sign in to comment.