From d155d7e31b84c06c8b6391095fe5da0bcd1dc742 Mon Sep 17 00:00:00 2001 From: Owen Date: Tue, 31 Mar 2026 12:26:31 -0700 Subject: [PATCH] Update formatting --- server/db/pg/schema/privateSchema.ts | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/server/db/pg/schema/privateSchema.ts b/server/db/pg/schema/privateSchema.ts index ed6301437..4122fb5b5 100644 --- a/server/db/pg/schema/privateSchema.ts +++ b/server/db/pg/schema/privateSchema.ts @@ -437,6 +437,27 @@ export const eventStreamingDestinations = pgTable( } ); +export const eventStreamingCursors = pgTable( + "eventStreamingCursors", + { + cursorId: serial("cursorId").primaryKey(), + destinationId: integer("destinationId") + .notNull() + .references(() => eventStreamingDestinations.destinationId, { + onDelete: "cascade" + }), + logType: varchar("logType", { length: 50 }).notNull(), // "request" | "action" | "access" | "connection" + lastSentId: bigint("lastSentId", { mode: "number" }).notNull().default(0), + lastSentAt: bigint("lastSentAt", { mode: "number" }) // epoch milliseconds, null if never sent + }, + (table) => [ + uniqueIndex("idx_eventStreamingCursors_dest_type").on( + table.destinationId, + table.logType + ) + ] +); + export type Approval = InferSelectModel; export type Limit = InferSelectModel; export type Account = InferSelectModel; @@ -471,28 +492,6 @@ export type SiteProvisioningKeyOrg = InferSelectModel< export type EventStreamingDestination = InferSelectModel< typeof eventStreamingDestinations >; - -export const eventStreamingCursors = pgTable( - "eventStreamingCursors", - { - cursorId: serial("cursorId").primaryKey(), - destinationId: integer("destinationId") - .notNull() - .references(() => eventStreamingDestinations.destinationId, { - onDelete: "cascade" - }), - logType: varchar("logType", { length: 50 }).notNull(), // "request" | "action" | "access" | "connection" - lastSentId: bigint("lastSentId", { mode: "number" }).notNull().default(0), - lastSentAt: bigint("lastSentAt", { mode: "number" }) // epoch milliseconds, null if never sent - }, - (table) => [ - uniqueIndex("idx_eventStreamingCursors_dest_type").on( - table.destinationId, - table.logType - ) - ] -); - export type EventStreamingCursor = InferSelectModel< typeof eventStreamingCursors >;