import { date, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { users } from "./auth"; // Time-limited hints for editorial users (e.g. "photographer is away at a // match today"). Visible from creation until `eventDate` plus the service // layer's visibility window, so expired hints never need a cleanup job. export const announcements = pgTable("announcements", { id: uuid("id").defaultRandom().primaryKey(), message: text("message").notNull(), eventDate: date("event_date").notNull(), createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), createdByUserId: uuid("created_by_user_id").references(() => users.id, { onDelete: "restrict", }), });