KI-AGENT: Matrix durch nativen FEDEO-Chat ersetzen

This commit is contained in:
2026-09-08 22:42:40 +02:00
parent 47bd8e80e4
commit 358e40d749
47 changed files with 1027 additions and 9766 deletions

View File

@@ -0,0 +1,34 @@
import { bigint, index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"
import { authUsers } from "./auth_users"
import { communicationRooms } from "./communication_rooms"
import { tenants } from "./tenants"
export const communicationMessages = pgTable(
"communication_messages",
{
id: bigint("id", { mode: "number" })
.primaryKey()
.generatedByDefaultAsIdentity(),
tenantId: bigint("tenant_id", { mode: "number" })
.notNull()
.references(() => tenants.id, { onDelete: "cascade" }),
roomId: uuid("room_id")
.notNull()
.references(() => communicationRooms.id, { onDelete: "cascade" }),
authorUserId: uuid("author_user_id")
.notNull()
.references(() => authUsers.id),
body: text("body").notNull(),
createdAt: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
},
(table) => ({
roomMessageIdx: index("communication_messages_room_message_idx").on(table.roomId, table.id),
tenantIdx: index("communication_messages_tenant_idx").on(table.tenantId),
})
)
export type CommunicationMessage = typeof communicationMessages.$inferSelect
export type NewCommunicationMessage = typeof communicationMessages.$inferInsert