KI-AGENT: Matrix durch nativen FEDEO-Chat ersetzen
This commit is contained in:
26
backend/db/schema/communication_room_reads.ts
Normal file
26
backend/db/schema/communication_room_reads.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { bigint, pgTable, primaryKey, timestamp, uuid } from "drizzle-orm/pg-core"
|
||||
|
||||
import { authUsers } from "./auth_users"
|
||||
import { communicationRooms } from "./communication_rooms"
|
||||
|
||||
export const communicationRoomReads = pgTable(
|
||||
"communication_room_reads",
|
||||
{
|
||||
roomId: uuid("room_id")
|
||||
.notNull()
|
||||
.references(() => communicationRooms.id, { onDelete: "cascade" }),
|
||||
userId: uuid("user_id")
|
||||
.notNull()
|
||||
.references(() => authUsers.id, { onDelete: "cascade" }),
|
||||
lastReadMessageId: bigint("last_read_message_id", { mode: "number" }),
|
||||
readAt: timestamp("read_at", { withTimezone: true })
|
||||
.notNull()
|
||||
.defaultNow(),
|
||||
},
|
||||
(table) => ({
|
||||
pk: primaryKey({ columns: [table.roomId, table.userId] }),
|
||||
})
|
||||
)
|
||||
|
||||
export type CommunicationRoomRead = typeof communicationRoomReads.$inferSelect
|
||||
export type NewCommunicationRoomRead = typeof communicationRoomReads.$inferInsert
|
||||
Reference in New Issue
Block a user