From 43544738d01c496f302ba0d938c088c5a7776b62 Mon Sep 17 00:00:00 2001
From: Ubuntu
Date: Sat, 10 Oct 2026 11:39:51 +0000
Subject: [PATCH] Add printing submission hours controls
---
.../printing-submission-hours/spec.md | 26 +
.../features/printing-submission-hours/srd.md | 37 +
.../printing-submission-hours/status.md | 18 +
.../printing-submission-hours/test-cases.md | 9 +
.../(portal)/_components/hacker-printing.tsx | 72 +-
.../_components/new-print-job-form.tsx | 20 +-
.../printing/printing-queue-workspace.tsx | 12 +
.../printing/printing-settings-dialog.tsx | 96 +-
packages/api/src/hacker-portal/printing.ts | 31 +-
packages/api/src/routers/printing.ts | 67 +-
.../src/tests/integration/printing.test.ts | 112 +-
packages/api/src/utils/printing/queue.ts | 45 +
.../db/drizzle/0062_little_slipstream.sql | 4 +
packages/db/drizzle/meta/0062_snapshot.json | 15077 ++++++++++++++++
packages/db/drizzle/meta/_journal.json | 7 +
packages/db/src/schemas/knight-hacks.ts | 14 +-
packages/validators/src/audit.ts | 6 +
packages/validators/src/hacker-portal.ts | 9 +
packages/validators/src/printing.ts | 19 +
19 files changed, 15661 insertions(+), 20 deletions(-)
create mode 100644 .forge/features/printing-submission-hours/spec.md
create mode 100644 .forge/features/printing-submission-hours/srd.md
create mode 100644 .forge/features/printing-submission-hours/status.md
create mode 100644 .forge/features/printing-submission-hours/test-cases.md
create mode 100644 packages/db/drizzle/0062_little_slipstream.sql
create mode 100644 packages/db/drizzle/meta/0062_snapshot.json
diff --git a/.forge/features/printing-submission-hours/spec.md b/.forge/features/printing-submission-hours/spec.md
new file mode 100644
index 000000000..6d0f0e146
--- /dev/null
+++ b/.forge/features/printing-submission-hours/spec.md
@@ -0,0 +1,26 @@
+# Printing Submission Hours
+
+## Goal
+
+Admins can control whether hackers may submit new 3D printing requests for a hackathon, because the printing team is only available on-site during limited hours.
+
+## Users
+
+- Hackers on the yearly portal printing dashboard.
+- Admins with Printing Queue access in Blade.
+
+## User-visible behavior
+
+- Hackers can always view their existing print jobs and the queue summary after check-in.
+- Hackers can only upload/submit a new print job while printing submissions are currently open.
+- When submissions are closed, the dashboard explains that printing is closed and shows the configured window when one exists.
+- Admins can set printing submissions open/closed for the selected hackathon.
+- Admins can optionally set an open and/or close time, making the control flexible for same-day on-site blocks or manual open-ended sessions.
+
+## Acceptance criteria
+
+- A missing printing configuration is safe-closed for new submissions.
+- Admins can save open/closed state and optional open/close times from the Printing settings dialog.
+- Hacker submit and upload API paths reject new order creation while submissions are closed.
+- The hacker dashboard disables the New print action while submissions are closed.
+- Existing print queue/status/cancel flows keep working while submissions are closed.
diff --git a/.forge/features/printing-submission-hours/srd.md b/.forge/features/printing-submission-hours/srd.md
new file mode 100644
index 000000000..97378efb8
--- /dev/null
+++ b/.forge/features/printing-submission-hours/srd.md
@@ -0,0 +1,37 @@
+# Printing Submission Hours SRD
+
+## Scope
+
+Blade printing configuration gains submission availability fields for one hackathon. The 2026 hacker portal consumes the queue DTO to render open/closed state and prevent new submissions.
+
+## Data model
+
+Extend `PrintingConfiguration` with:
+
+- `submissionsEnabled boolean not null default false`
+- `submissionsOpenAt timestamptz null`
+- `submissionsCloseAt timestamptz null`
+
+A check constraint requires `submissionsOpenAt < submissionsCloseAt` when both are present.
+
+## Open-state rule
+
+`isOpen = submissionsEnabled && (openAt == null || openAt <= now) && (closeAt == null || closeAt > now)`.
+
+Missing configuration uses defaults: disabled, no window, existing print estimate defaults.
+
+## API contracts
+
+- Admin tRPC `printing.getConfiguration` returns submission state.
+- Admin tRPC `printing.setSubmissionWindow` saves the enabled flag and nullable open/close timestamps.
+- Hacker `listPrintJobs` includes `queue.submissions` with enabled/open/close/isOpen timestamps.
+- Hacker `uploadPrintFile` and `submitPrintJob` reject with `PRINTING_CLOSED` when `isOpen` is false.
+
+## UI contracts
+
+- Blade admin settings dialog adds a Printing availability section.
+- Hacker printing dashboard shows an open/closed notice and disables New print when closed.
+
+## Rollout
+
+Migration defaults closed for safety. Admins must explicitly open printing for a hackathon.
diff --git a/.forge/features/printing-submission-hours/status.md b/.forge/features/printing-submission-hours/status.md
new file mode 100644
index 000000000..2b2aa62c1
--- /dev/null
+++ b/.forge/features/printing-submission-hours/status.md
@@ -0,0 +1,18 @@
+# Printing Submission Hours Status
+
+## Phase
+
+Implementation complete; ready for review.
+
+## Decisions
+
+- Missing config defaults to closed for new submissions.
+- Admins get a flexible enabled toggle plus optional open/close timestamps.
+- Existing jobs remain visible/manageable while new uploads/submits are closed.
+
+## Validation
+
+- Passed: `pnpm format`.
+- Passed: `pnpm lint` (repo has existing warnings only).
+- Passed: `pnpm typecheck`.
+- Passed command / skipped by environment: `pnpm --filter=@forge/api test -- src/tests/integration/printing.test.ts` (20 database integration tests skipped because the local test environment did not enable the disposable database suite).
diff --git a/.forge/features/printing-submission-hours/test-cases.md b/.forge/features/printing-submission-hours/test-cases.md
new file mode 100644
index 000000000..b14b24d82
--- /dev/null
+++ b/.forge/features/printing-submission-hours/test-cases.md
@@ -0,0 +1,9 @@
+# Printing Submission Hours Test Cases
+
+- TC-001: Missing printing configuration returns submissions disabled and closed while preserving default queue estimates.
+- TC-002: Admin with Printing Queue permission can save submissions enabled with an optional open/close window; configuration reads back the exact state.
+- TC-003: Checked-in hacker can submit and upload while submissions are enabled and the current time is within the optional window.
+- TC-004: Checked-in hacker cannot upload or submit while submissions are disabled.
+- TC-005: Checked-in hacker cannot upload or submit before a future open time or after a close time.
+- TC-006: Existing job listing and cancellation still work while submissions are closed.
+- TC-007: Hacker portal disables the New print action and explains closed/open-window state when queue submissions are closed.
diff --git a/apps/2026/src/app/(portal)/_components/hacker-printing.tsx b/apps/2026/src/app/(portal)/_components/hacker-printing.tsx
index 55bd7a344..8d3ea4308 100644
--- a/apps/2026/src/app/(portal)/_components/hacker-printing.tsx
+++ b/apps/2026/src/app/(portal)/_components/hacker-printing.tsx
@@ -79,6 +79,59 @@ export function HackerPrinting() {
return ;
}
+function formatSubmissionTime(value: string, timeZone: string) {
+ return new Intl.DateTimeFormat("en-US", {
+ day: "numeric",
+ hour: "numeric",
+ minute: "2-digit",
+ month: "short",
+ timeZone,
+ }).format(new Date(value));
+}
+
+function PrintingClosedCopy({
+ submissions,
+ timeZone,
+}: {
+ submissions:
+ | {
+ closeAt: string | null;
+ enabled: boolean;
+ isOpen: boolean;
+ openAt: string | null;
+ }
+ | undefined;
+ timeZone: string;
+}) {
+ if (!submissions) return <>Checking whether printing is on-siteā¦>;
+ if (!submissions.enabled) {
+ return (
+ <>
+ Printing is closed right now. Organizers will reopen submissions when
+ the printers are on-site.
+ >
+ );
+ }
+ if (submissions.openAt) {
+ return (
+ <>Printing opens {formatSubmissionTime(submissions.openAt, timeZone)}.>
+ );
+ }
+ if (submissions.closeAt) {
+ return (
+ <>
+ Printing closed {formatSubmissionTime(submissions.closeAt, timeZone)}.
+ >
+ );
+ }
+ return (
+ <>
+ Printing is closed right now. Check back when organizers reopen
+ submissions.
+ >
+ );
+}
+
function PrintingWorkshop({ timeZone }: { timeZone: string }) {
const flow = useHackerPrintingFlow();
const queue = flow.jobsQuery.data?.queue;
@@ -104,7 +157,11 @@ function PrintingWorkshop({ timeZone }: { timeZone: string }) {
3D Printing
Send your model, track its progress and collect your print.
- setView("active")} />
+ setView("active")}
+ />
@@ -158,8 +215,17 @@ function PrintingWorkshop({ timeZone }: { timeZone: string }) {
)}
- Each print takes {formatPrintTime(queue?.printMinutes ?? 60)}. First
- come, first served; ready times may change.
+ {queue?.submissions.isOpen ? (
+ <>
+ Each print takes {formatPrintTime(queue.printMinutes)}. First
+ come, first served; ready times may change.
+ >
+ ) : (
+
+ )}
diff --git a/apps/2026/src/app/(portal)/_components/new-print-job-form.tsx b/apps/2026/src/app/(portal)/_components/new-print-job-form.tsx
index a5a956925..ae6f4173d 100644
--- a/apps/2026/src/app/(portal)/_components/new-print-job-form.tsx
+++ b/apps/2026/src/app/(portal)/_components/new-print-job-form.tsx
@@ -37,9 +37,11 @@ function errorMessage(error: unknown, fallback: string) {
}
export function NewPrintJobForm({
+ disabled,
flow,
onSubmitted,
}: {
+ disabled: boolean;
flow: ReturnType;
onSubmitted: () => void;
}) {
@@ -56,6 +58,7 @@ export function NewPrintJobForm({
// file then would race the submit that already holds the list.
const submitting = flow.submitMutation.isPending;
const canSubmit =
+ !disabled &&
description.trim() !== "" &&
uploadedIds.length > 0 &&
!uploading &&
@@ -69,6 +72,10 @@ export function NewPrintJobForm({
}
function addFiles(list: FileList) {
+ if (disabled) {
+ toast.error("Printing is not accepting new requests right now.");
+ return;
+ }
const room = PRINTING.MAX_PRINT_JOB_FILES - files.length;
const picked = Array.from(list).slice(0, Math.max(room, 0));
if (list.length > picked.length) {
@@ -106,6 +113,10 @@ export function NewPrintJobForm({
async function submit() {
try {
+ if (disabled) {
+ toast.error("Printing is not accepting new requests right now.");
+ return;
+ }
const job = await flow.submit({
description: description.trim(),
fileIds: uploadedIds,
@@ -132,7 +143,7 @@ export function NewPrintJobForm({
}}
>
-
+
New print
@@ -196,13 +207,16 @@ export function NewPrintJobForm({
) : null}
{files.length < PRINTING.MAX_PRINT_JOB_FILES ? (
-
+
Add files
{
if (event.target.files) addFiles(event.target.files);
diff --git a/apps/blade/src/app/_components/admin/printing/printing-queue-workspace.tsx b/apps/blade/src/app/_components/admin/printing/printing-queue-workspace.tsx
index ea87421fb..41205dc45 100644
--- a/apps/blade/src/app/_components/admin/printing/printing-queue-workspace.tsx
+++ b/apps/blade/src/app/_components/admin/printing/printing-queue-workspace.tsx
@@ -147,6 +147,18 @@ export function PrintingQueueWorkspace({
{queue.settings.printerCount}{" "}
{queue.settings.printerCount === 1 ? "printer" : "printers"}
+
+ {configuration.submissions.isOpen
+ ? "Submissions open"
+ : "Submissions closed"}
+
router.refresh());
@@ -98,6 +138,13 @@ export function PrintingSettingsDialog({
setChannelId(configuration.channelId ?? NO_CHANNEL);
setPrintMinutes(String(configuration.printMinutes));
setPrinterCount(String(configuration.printerCount));
+ setSubmissionsEnabled(configuration.submissions.enabled);
+ setSubmissionsOpenAt(
+ toDateTimeLocal(configuration.submissions.openAt),
+ );
+ setSubmissionsCloseAt(
+ toDateTimeLocal(configuration.submissions.closeAt),
+ );
}
}}
open={open}
@@ -121,6 +168,53 @@ export function PrintingSettingsDialog({
void save();
}}
>
+
+
+
+
+ Accept new print jobs
+
+
+ Hackers can only upload files and send new requests while this
+ is on and the optional window includes the current time.
+
+
+
+
+
+
+ Leave times blank for a manual on/off switch, or set one side for
+ an open-ended block.
+
+
New job channel
diff --git a/packages/api/src/hacker-portal/printing.ts b/packages/api/src/hacker-portal/printing.ts
index b045b89ae..ee99fbd28 100644
--- a/packages/api/src/hacker-portal/printing.ts
+++ b/packages/api/src/hacker-portal/printing.ts
@@ -35,7 +35,10 @@ import {
removePrintFileObjects,
} from "../utils/printing/files";
import { notifyNewPrintJob } from "../utils/printing/notifications";
-import { loadQueueEstimates } from "../utils/printing/queue";
+import {
+ loadQueueEstimates,
+ loadSubmissionWindow,
+} from "../utils/printing/queue";
import { runParticipantCommand } from "./commands";
import { requireApplicationWithStatuses } from "./reads";
import { portalFailure } from "./trpc";
@@ -45,6 +48,21 @@ export function requirePrintUploadAccess(ctx: AuthenticatedPortalContext) {
return requireApplicationWithStatuses(ctx, ["checkedin"]);
}
+async function requirePrintingSubmissionsOpen(
+ hackathonId: string,
+ executor: WriteDb = db,
+) {
+ const window = await loadSubmissionWindow(hackathonId, executor);
+ if (!window.isOpen) {
+ portalFailure(
+ "PRINTING_CLOSED",
+ "3D printing is not accepting new requests right now. Please check back when printing is on-site.",
+ { trpcCode: "PRECONDITION_FAILED" },
+ );
+ }
+ return window;
+}
+
type PrintJobRow = Pick<
typeof PrintJob.$inferSelect,
| "createdAt"
@@ -150,6 +168,7 @@ export async function uploadPrintFile(
input: { bytes: Uint8Array; contentType: string; fileName: string },
): Promise {
const application = await requirePrintUploadAccess(ctx);
+ await requirePrintingSubmissionsOpen(ctx.session.hackathonId);
const check = checkUploadContent(PRINT_FILE_UPLOAD_POLICY, input);
if (!check.ok) {
portalFailure("INVALID_PRINT_FILE", check.message, {
@@ -271,12 +290,13 @@ export async function listPrintJobs(
),
)
.orderBy(desc(PrintJob.createdAt), desc(PrintJob.id));
- const [files, queue] = await Promise.all([
+ const [files, queue, submissions] = await Promise.all([
loadJobFiles(
jobs.map((job) => job.id),
db,
),
loadQueueEstimates(ctx.session.hackathonId),
+ loadSubmissionWindow(ctx.session.hackathonId),
]);
return {
jobs: jobs.map((job) =>
@@ -285,6 +305,12 @@ export async function listPrintJobs(
queue: {
estimatedWaitMinutes: queue.waitMinutes,
printMinutes: queue.settings.printMinutes,
+ submissions: {
+ closeAt: submissions.closeAt?.toISOString() ?? null,
+ enabled: submissions.enabled,
+ isOpen: submissions.isOpen,
+ openAt: submissions.openAt?.toISOString() ?? null,
+ },
waitingCount: queue.waitingCount,
},
};
@@ -309,6 +335,7 @@ export async function submitPrintJob(
tx,
userId: ctx.session.userId,
work: async () => {
+ await requirePrintingSubmissionsOpen(ctx.session.hackathonId, tx);
const [job] = await tx
.insert(PrintJob)
.values({
diff --git a/packages/api/src/routers/printing.ts b/packages/api/src/routers/printing.ts
index d38410368..2d76196ee 100644
--- a/packages/api/src/routers/printing.ts
+++ b/packages/api/src/routers/printing.ts
@@ -18,6 +18,7 @@ import {
printingSetChannelInputSchema,
printingSetEstimatedReadyAtInputSchema,
printingSetEstimateSettingsInputSchema,
+ printingSetSubmissionWindowInputSchema,
printingUpdateStatusInputSchema,
} from "@forge/validators";
@@ -36,6 +37,7 @@ import {
isActivePrintJobStatus,
loadEstimateSettings,
loadQueueEstimates,
+ resolvePrintSubmissionWindow,
} from "../utils/printing/queue";
import { resolveRoleDiscordGateway } from "../utils/roles/discord-gateway";
@@ -89,7 +91,12 @@ async function upsertConfiguration(
values: Partial<
Pick<
typeof PrintingConfiguration.$inferInsert,
- "discordChannelId" | "printMinutes" | "printerCount"
+ | "discordChannelId"
+ | "printMinutes"
+ | "printerCount"
+ | "submissionsCloseAt"
+ | "submissionsEnabled"
+ | "submissionsOpenAt"
>
>,
) {
@@ -400,13 +407,19 @@ export const printingRouter = createTRPCRouter({
.query(async ({ ctx, input }) => {
requirePrintingQueue(ctx);
const [row] = await db
- .select({ channelId: PrintingConfiguration.discordChannelId })
+ .select({
+ channelId: PrintingConfiguration.discordChannelId,
+ submissionsCloseAt: PrintingConfiguration.submissionsCloseAt,
+ submissionsEnabled: PrintingConfiguration.submissionsEnabled,
+ submissionsOpenAt: PrintingConfiguration.submissionsOpenAt,
+ })
.from(PrintingConfiguration)
.where(eq(PrintingConfiguration.hackathonId, input.hackathonId))
.limit(1);
return {
channelId: row?.channelId ?? null,
...(await loadEstimateSettings(input.hackathonId)),
+ submissions: resolvePrintSubmissionWindow(row ?? null),
};
}),
@@ -458,6 +471,56 @@ export const printingRouter = createTRPCRouter({
});
}),
+ /** Enables/disables hacker print submissions with optional open and close times. */
+ setSubmissionWindow: permProcedure
+ .input(printingSetSubmissionWindowInputSchema)
+ .mutation(async ({ ctx, input }) => {
+ requirePrintingQueue(ctx);
+ await requireHackathon(input.hackathonId);
+ const auditActor = await captureAdminAuditActor(ctx.session.user);
+ return db.transaction(async (tx) => {
+ const before = await lockConfiguration(tx, input.hackathonId);
+ const row = await upsertConfiguration(tx, input.hackathonId, {
+ submissionsCloseAt: input.closeAt,
+ submissionsEnabled: input.enabled,
+ submissionsOpenAt: input.openAt,
+ });
+ await createAdminAuditEvent(
+ {
+ actionKey: "printing.submissions.updated",
+ actor: auditActor,
+ changes: [
+ {
+ after: row.submissionsEnabled,
+ before: before?.submissionsEnabled ?? false,
+ field: "submissionsEnabled",
+ },
+ {
+ after: row.submissionsOpenAt?.toISOString() ?? null,
+ before: before?.submissionsOpenAt?.toISOString() ?? null,
+ field: "submissionsOpenAt",
+ },
+ {
+ after: row.submissionsCloseAt?.toISOString() ?? null,
+ before: before?.submissionsCloseAt?.toISOString() ?? null,
+ field: "submissionsCloseAt",
+ },
+ ].filter((change) => change.before !== change.after),
+ subjects: [
+ {
+ relation: "primary",
+ targetId: input.hackathonId,
+ targetLabel: "3D printing configuration",
+ targetType: "printing_configuration",
+ },
+ ],
+ },
+ tx,
+ );
+ return resolvePrintSubmissionWindow(row);
+ });
+ }),
+
/** Print time and printer count used for ready-time estimates. */
setEstimateSettings: permProcedure
.input(printingSetEstimateSettingsInputSchema)
diff --git a/packages/api/src/tests/integration/printing.test.ts b/packages/api/src/tests/integration/printing.test.ts
index 4d11cd770..e9687b31f 100644
--- a/packages/api/src/tests/integration/printing.test.ts
+++ b/packages/api/src/tests/integration/printing.test.ts
@@ -235,6 +235,10 @@ describe.skipIf(!canRunDatabaseTests())("3D printing queue", () => {
theme: "Printing",
timezone: "America/New_York",
});
+ await client.insert(knightHacks.PrintingConfiguration).values({
+ hackathonId,
+ submissionsEnabled: true,
+ });
}, 30_000);
afterAll(async () => {
@@ -242,6 +246,89 @@ describe.skipIf(!canRunDatabaseTests())("3D printing queue", () => {
await disposable?.drop();
}, 30_000);
+ it("defaults missing printing configuration to closed submissions", async () => {
+ await client
+ .delete(knightHacks.PrintingConfiguration)
+ .where(eq(knightHacks.PrintingConfiguration.hackathonId, hackathonId));
+ const caller = await bladeCaller(permissionBitstring("PRINTING_QUEUE"));
+
+ await expect(
+ caller.printing.getConfiguration({ hackathonId }),
+ ).resolves.toMatchObject({
+ channelId: null,
+ submissions: {
+ closeAt: null,
+ enabled: false,
+ isOpen: false,
+ openAt: null,
+ },
+ });
+ const hacker = await seedHacker("closed", "checkedin");
+ await rejectsWithCode(
+ printing.uploadPrintFile(hacker.ctx, {
+ bytes: new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]),
+ contentType: "image/png",
+ fileName: "reference.png",
+ }),
+ "PRINTING_CLOSED",
+ );
+ await rejectsWithCode(
+ submit(hacker.ctx, [await stageFile(hacker.attendeeId)]),
+ "PRINTING_CLOSED",
+ );
+ });
+
+ it("lets admins configure flexible submission hours", async () => {
+ const caller = await bladeCaller(permissionBitstring("PRINTING_QUEUE"));
+ const openAt = new Date(Date.now() - 30 * 60_000);
+ const closeAt = new Date(Date.now() + 90 * 60_000);
+
+ await caller.printing.setSubmissionWindow({
+ closeAt,
+ enabled: true,
+ hackathonId,
+ openAt,
+ });
+
+ await expect(
+ caller.printing.getConfiguration({ hackathonId }),
+ ).resolves.toMatchObject({
+ submissions: {
+ closeAt,
+ enabled: true,
+ isOpen: true,
+ openAt,
+ },
+ });
+ });
+
+ it("closes submissions outside the configured window", async () => {
+ const caller = await bladeCaller(permissionBitstring("PRINTING_QUEUE"));
+ await caller.printing.setSubmissionWindow({
+ closeAt: new Date(Date.now() + 120 * 60_000),
+ enabled: true,
+ hackathonId,
+ openAt: new Date(Date.now() + 60 * 60_000),
+ });
+ const hacker = await seedHacker("future", "checkedin");
+
+ await rejectsWithCode(
+ submit(hacker.ctx, [await stageFile(hacker.attendeeId)]),
+ "PRINTING_CLOSED",
+ );
+
+ await caller.printing.setSubmissionWindow({
+ closeAt: new Date(Date.now() - 60 * 60_000),
+ enabled: true,
+ hackathonId,
+ openAt: new Date(Date.now() - 120 * 60_000),
+ });
+ await rejectsWithCode(
+ submit(hacker.ctx, [await stageFile(hacker.attendeeId)]),
+ "PRINTING_CLOSED",
+ );
+ });
+
it("[TC-002/012] submits a job with staged files and estimates its place", async () => {
const hacker = await seedHacker("ada", "checkedin");
const first = await submit(hacker.ctx, [
@@ -257,9 +344,10 @@ describe.skipIf(!canRunDatabaseTests())("3D printing queue", () => {
const list = await printing.listPrintJobs(hacker.ctx);
expect(list.jobs.map((job) => job.id)).toEqual([second.id, first.id]);
- expect(list.queue).toEqual({
+ expect(list.queue).toMatchObject({
estimatedWaitMinutes: 180,
printMinutes: 60,
+ submissions: { enabled: true, isOpen: true },
waitingCount: 2,
});
const minutesAway =
@@ -392,6 +480,10 @@ describe.skipIf(!canRunDatabaseTests())("3D printing queue", () => {
theme: "Printing",
timezone: "America/New_York",
});
+ await client.insert(knightHacks.PrintingConfiguration).values({
+ hackathonId: otherHackathonId,
+ submissionsEnabled: true,
+ });
hackathonId = otherHackathonId;
const otherAttendee = await seedHacker("elsewhere", "checkedin");
await submit(otherAttendee.ctx, [
@@ -498,10 +590,16 @@ describe.skipIf(!canRunDatabaseTests())("3D printing queue", () => {
});
await expect(
caller.printing.getConfiguration({ hackathonId }),
- ).resolves.toEqual({ channelId: null, printMinutes: 45, printerCount: 2 });
- expect((await printing.listPrintJobs(hacker.ctx)).queue).toEqual({
+ ).resolves.toMatchObject({
+ channelId: null,
+ printMinutes: 45,
+ printerCount: 2,
+ submissions: { enabled: true, isOpen: true },
+ });
+ expect((await printing.listPrintJobs(hacker.ctx)).queue).toMatchObject({
estimatedWaitMinutes: 45,
printMinutes: 45,
+ submissions: { enabled: true, isOpen: true },
waitingCount: 0,
});
@@ -537,10 +635,10 @@ describe.skipIf(!canRunDatabaseTests())("3D printing queue", () => {
permissions: permissionBitstring("IS_OFFICER"),
},
]);
- await client.insert(knightHacks.PrintingConfiguration).values({
- discordChannelId: "333333333333333333",
- hackathonId,
- });
+ await client
+ .update(knightHacks.PrintingConfiguration)
+ .set({ discordChannelId: "333333333333333333" })
+ .where(eq(knightHacks.PrintingConfiguration.hackathonId, hackathonId));
const input = {
description: "Keychain",
fileIds: [await stageFile(hacker.attendeeId)],
diff --git a/packages/api/src/utils/printing/queue.ts b/packages/api/src/utils/printing/queue.ts
index ed6b6770c..ffb56eef1 100644
--- a/packages/api/src/utils/printing/queue.ts
+++ b/packages/api/src/utils/printing/queue.ts
@@ -10,6 +10,34 @@ import type { WriteDb } from "../db";
import type { PrintEstimateSettings } from "./estimate";
import { estimateReadyTimes, estimateWaitMinutes } from "./estimate";
+export interface PrintSubmissionWindow {
+ closeAt: Date | null;
+ enabled: boolean;
+ isOpen: boolean;
+ openAt: Date | null;
+}
+
+export function resolvePrintSubmissionWindow(
+ row: Pick<
+ typeof PrintingConfiguration.$inferSelect,
+ "submissionsCloseAt" | "submissionsEnabled" | "submissionsOpenAt"
+ > | null,
+ now = new Date(),
+): PrintSubmissionWindow {
+ const enabled = row?.submissionsEnabled ?? false;
+ const openAt = row?.submissionsOpenAt ?? null;
+ const closeAt = row?.submissionsCloseAt ?? null;
+ return {
+ closeAt,
+ enabled,
+ isOpen:
+ enabled &&
+ (openAt === null || openAt.getTime() <= now.getTime()) &&
+ (closeAt === null || closeAt.getTime() > now.getTime()),
+ openAt,
+ };
+}
+
/** The hackathon's estimate settings, or the defaults when it has no row. */
export async function loadEstimateSettings(
hackathonId: string,
@@ -31,6 +59,23 @@ export async function loadEstimateSettings(
);
}
+export async function loadSubmissionWindow(
+ hackathonId: string,
+ executor: WriteDb = db,
+ now = new Date(),
+): Promise {
+ const [row] = await executor
+ .select({
+ submissionsCloseAt: PrintingConfiguration.submissionsCloseAt,
+ submissionsEnabled: PrintingConfiguration.submissionsEnabled,
+ submissionsOpenAt: PrintingConfiguration.submissionsOpenAt,
+ })
+ .from(PrintingConfiguration)
+ .where(eq(PrintingConfiguration.hackathonId, hackathonId))
+ .limit(1);
+ return resolvePrintSubmissionWindow(row ?? null, now);
+}
+
/**
* Estimates for every active job at a hackathon. Reads the whole active queue;
* a hackathon has tens of jobs. If it ever has thousands, number the rows in
diff --git a/packages/db/drizzle/0062_little_slipstream.sql b/packages/db/drizzle/0062_little_slipstream.sql
new file mode 100644
index 000000000..734248b11
--- /dev/null
+++ b/packages/db/drizzle/0062_little_slipstream.sql
@@ -0,0 +1,4 @@
+ALTER TABLE "knight_hacks_printing_configuration" ADD COLUMN "submissions_enabled" boolean DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE "knight_hacks_printing_configuration" ADD COLUMN "submissions_open_at" timestamp with time zone;--> statement-breakpoint
+ALTER TABLE "knight_hacks_printing_configuration" ADD COLUMN "submissions_close_at" timestamp with time zone;--> statement-breakpoint
+ALTER TABLE "knight_hacks_printing_configuration" ADD CONSTRAINT "knight_hacks_printing_configuration_window_check" CHECK ("knight_hacks_printing_configuration"."submissions_open_at" IS NULL OR "knight_hacks_printing_configuration"."submissions_close_at" IS NULL OR "knight_hacks_printing_configuration"."submissions_open_at" < "knight_hacks_printing_configuration"."submissions_close_at");
\ No newline at end of file
diff --git a/packages/db/drizzle/meta/0062_snapshot.json b/packages/db/drizzle/meta/0062_snapshot.json
new file mode 100644
index 000000000..cbaab9934
--- /dev/null
+++ b/packages/db/drizzle/meta/0062_snapshot.json
@@ -0,0 +1,15077 @@
+{
+ "id": "7ff3ea3e-3026-470a-b4f5-32e9488a3e7d",
+ "prevId": "7d00478d-2200-49ba-94e6-611a9b3740a4",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.audit_event": {
+ "name": "audit_event",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "occurred_at": {
+ "name": "occurred_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "action_key": {
+ "name": "action_key",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain": {
+ "name": "domain",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "outcome": {
+ "name": "outcome",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation_id": {
+ "name": "operation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_user_id": {
+ "name": "actor_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_member_id": {
+ "name": "actor_member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_discord_user_id": {
+ "name": "actor_discord_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_label": {
+ "name": "actor_label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_role_label": {
+ "name": "actor_role_label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_role_color": {
+ "name": "actor_role_color",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "changes": {
+ "name": "changes",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {
+ "audit_event_action_occurred_idx": {
+ "name": "audit_event_action_occurred_idx",
+ "columns": [
+ {
+ "expression": "action_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "occurred_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_event_actor_occurred_idx": {
+ "name": "audit_event_actor_occurred_idx",
+ "columns": [
+ {
+ "expression": "actor_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "occurred_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_event_actor_member_occurred_idx": {
+ "name": "audit_event_actor_member_occurred_idx",
+ "columns": [
+ {
+ "expression": "actor_member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "occurred_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_event_domain_occurred_idx": {
+ "name": "audit_event_domain_occurred_idx",
+ "columns": [
+ {
+ "expression": "domain",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "occurred_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_event_occurred_idx": {
+ "name": "audit_event_occurred_idx",
+ "columns": [
+ {
+ "expression": "occurred_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_event_operation_idx": {
+ "name": "audit_event_operation_idx",
+ "columns": [
+ {
+ "expression": "operation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_event_outcome_occurred_idx": {
+ "name": "audit_event_outcome_occurred_idx",
+ "columns": [
+ {
+ "expression": "outcome",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "occurred_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "audit_event_actor_role_color_check": {
+ "name": "audit_event_actor_role_color_check",
+ "value": "\"audit_event\".\"actor_role_color\" IS NULL OR \"audit_event\".\"actor_role_color\" ~ '^#[0-9A-Fa-f]{6}$'"
+ },
+ "audit_event_outcome_check": {
+ "name": "audit_event_outcome_check",
+ "value": "\"audit_event\".\"outcome\" IN ('committed', 'partial_external')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.audit_subject": {
+ "name": "audit_subject",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "relation": {
+ "name": "relation",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_type": {
+ "name": "target_type",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_label": {
+ "name": "target_label",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result_outcome": {
+ "name": "result_outcome",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ }
+ },
+ "indexes": {
+ "audit_subject_event_position_idx": {
+ "name": "audit_subject_event_position_idx",
+ "columns": [
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "position",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_subject_member_event_idx": {
+ "name": "audit_subject_member_event_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_subject_one_primary_idx": {
+ "name": "audit_subject_one_primary_idx",
+ "columns": [
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"audit_subject\".\"relation\" = 'primary'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "audit_subject_target_event_idx": {
+ "name": "audit_subject_target_event_idx",
+ "columns": [
+ {
+ "expression": "target_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "audit_subject_event_id_audit_event_id_fk": {
+ "name": "audit_subject_event_id_audit_event_id_fk",
+ "tableFrom": "audit_subject",
+ "tableTo": "audit_event",
+ "columnsFrom": ["event_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "audit_subject_relation_check": {
+ "name": "audit_subject_relation_check",
+ "value": "\"audit_subject\".\"relation\" IN ('primary', 'secondary', 'result')"
+ },
+ "audit_subject_result_outcome_check": {
+ "name": "audit_subject_result_outcome_check",
+ "value": "\"audit_subject\".\"result_outcome\" IS NULL OR \"audit_subject\".\"result_outcome\" IN ('succeeded', 'skipped', 'failed_external', 'failed_internal', 'compensated')"
+ },
+ "audit_subject_result_outcome_shape_check": {
+ "name": "audit_subject_result_outcome_shape_check",
+ "value": "(\"audit_subject\".\"relation\" = 'result') = (\"audit_subject\".\"result_outcome\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.auth_account": {
+ "name": "auth_account",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_account_id": {
+ "name": "provider_account_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "id_token": {
+ "name": "id_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "auth_account_user_id_auth_user_id_fk": {
+ "name": "auth_account_user_id_auth_user_id_fk",
+ "tableFrom": "auth_account",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "auth_account_provider_provider_account_id_pk": {
+ "name": "auth_account_provider_provider_account_id_pk",
+ "columns": ["provider", "provider_account_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auth_permissions": {
+ "name": "auth_permissions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "auth_permissions_role_id_auth_roles_id_fk": {
+ "name": "auth_permissions_role_id_auth_roles_id_fk",
+ "tableFrom": "auth_permissions",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "auth_permissions_user_id_auth_user_id_fk": {
+ "name": "auth_permissions_user_id_auth_user_id_fk",
+ "tableFrom": "auth_permissions",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auth_roles": {
+ "name": "auth_roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "discord_role_id": {
+ "name": "discord_role_id",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_feedback_excluded": {
+ "name": "event_feedback_excluded",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "email_audience_enabled": {
+ "name": "email_audience_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "issue_reminder_channel": {
+ "name": "issue_reminder_channel",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'1459204271655489567'"
+ },
+ "issue_reminders_enabled": {
+ "name": "issue_reminders_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "team_hexcode_color": {
+ "name": "team_hexcode_color",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "auth_roles_discordRoleId_unique": {
+ "name": "auth_roles_discordRoleId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["discord_role_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auth_session": {
+ "name": "auth_session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "session_token": {
+ "name": "session_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires": {
+ "name": "expires",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "auth_session_user_id_auth_user_id_fk": {
+ "name": "auth_session_user_id_auth_user_id_fk",
+ "tableFrom": "auth_session",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auth_user": {
+ "name": "auth_user",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "discord_user_id": {
+ "name": "discord_user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email_verified": {
+ "name": "email_verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "image": {
+ "name": "image",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.auth_verification": {
+ "name": "auth_verification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_club_team": {
+ "name": "knight_hacks_club_team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "slug": {
+ "name": "slug",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "heading": {
+ "name": "heading",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_club_team_display_order_unique": {
+ "name": "knight_hacks_club_team_display_order_unique",
+ "columns": [
+ {
+ "expression": "display_order",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_club_team_kind_unique": {
+ "name": "knight_hacks_club_team_kind_unique",
+ "columns": [
+ {
+ "expression": "kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_club_team\".\"kind\" <> 'team'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_club_team_slug_unique": {
+ "name": "knight_hacks_club_team_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": ["slug"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_club_team_kind_check": {
+ "name": "knight_hacks_club_team_kind_check",
+ "value": "\"knight_hacks_club_team\".\"kind\" IN ('executive', 'director', 'team')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_club_team_role": {
+ "name": "knight_hacks_club_team_role",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rank": {
+ "name": "rank",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "roster_label": {
+ "name": "roster_label",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "callout_label": {
+ "name": "callout_label",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_club_team_role_role_id_auth_roles_id_fk": {
+ "name": "knight_hacks_club_team_role_role_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_club_team_role",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_club_team_role_team_id_knight_hacks_club_team_id_fk": {
+ "name": "knight_hacks_club_team_role_team_id_knight_hacks_club_team_id_fk",
+ "tableFrom": "knight_hacks_club_team_role",
+ "tableTo": "knight_hacks_club_team",
+ "columnsFrom": ["team_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_club_team_role_roleId_unique": {
+ "name": "knight_hacks_club_team_role_roleId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["role_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_club_team_role_kind_check": {
+ "name": "knight_hacks_club_team_role_kind_check",
+ "value": "\"knight_hacks_club_team_role\".\"kind\" IN ('executive', 'director', 'team')"
+ },
+ "knight_hacks_club_team_role_team_check": {
+ "name": "knight_hacks_club_team_role_team_check",
+ "value": "\"knight_hacks_club_team_role\".\"kind\" <> 'team' OR \"knight_hacks_club_team_role\".\"team_id\" IS NOT NULL"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_discord_config": {
+ "name": "knight_hacks_discord_config",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "key": {
+ "name": "key",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "production_id": {
+ "name": "production_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "development_id": {
+ "name": "development_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_discord_config_key_unique": {
+ "name": "knight_hacks_discord_config_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_discord_config_kind_check": {
+ "name": "knight_hacks_discord_config_kind_check",
+ "value": "\"knight_hacks_discord_config\".\"kind\" IN ('channel', 'guild', 'role')"
+ },
+ "knight_hacks_discord_config_production_id_check": {
+ "name": "knight_hacks_discord_config_production_id_check",
+ "value": "\"knight_hacks_discord_config\".\"production_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_discord_config_development_id_check": {
+ "name": "knight_hacks_discord_config_development_id_check",
+ "value": "\"knight_hacks_discord_config\".\"development_id\" IS NULL OR \"knight_hacks_discord_config\".\"development_id\" ~ '^[0-9]{17,20}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.discord_archive_channel": {
+ "name": "discord_archive_channel",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(20)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "guild_id": {
+ "name": "guild_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "topic": {
+ "name": "topic",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_thread": {
+ "name": "is_thread",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_private_thread": {
+ "name": "is_private_thread",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "locked": {
+ "name": "locked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "discovered_at": {
+ "name": "discovered_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "discord_updated_at": {
+ "name": "discord_updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "discord_archive_channel_guild_type_idx": {
+ "name": "discord_archive_channel_guild_type_idx",
+ "columns": [
+ {
+ "expression": "guild_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "discord_archive_channel_parent_idx": {
+ "name": "discord_archive_channel_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.discord_archive_checkpoint": {
+ "name": "discord_archive_checkpoint",
+ "schema": "",
+ "columns": {
+ "channel_id": {
+ "name": "channel_id",
+ "type": "varchar(20)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "guild_id": {
+ "name": "guild_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "oldest_message_id": {
+ "name": "oldest_message_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "newest_message_id": {
+ "name": "newest_message_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backfill_before_message_id": {
+ "name": "backfill_before_message_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "backfill_status": {
+ "name": "backfill_status",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "backfill_completed_at": {
+ "name": "backfill_completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_backfill_at": {
+ "name": "last_backfill_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_discovered_at": {
+ "name": "last_discovered_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_reconciled_at": {
+ "name": "last_reconciled_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "processed_message_count": {
+ "name": "processed_message_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_count": {
+ "name": "retry_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_error_code": {
+ "name": "last_error_code",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error_message": {
+ "name": "last_error_message",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "discord_archive_checkpoint_guild_status_updated_idx": {
+ "name": "discord_archive_checkpoint_guild_status_updated_idx",
+ "columns": [
+ {
+ "expression": "guild_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "backfill_status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "discord_archive_checkpoint_channel_id_discord_archive_channel_id_fk": {
+ "name": "discord_archive_checkpoint_channel_id_discord_archive_channel_id_fk",
+ "tableFrom": "discord_archive_checkpoint",
+ "tableTo": "discord_archive_channel",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "discord_archive_checkpoint_status_check": {
+ "name": "discord_archive_checkpoint_status_check",
+ "value": "\"discord_archive_checkpoint\".\"backfill_status\" IN ('pending', 'running', 'complete', 'failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.discord_archive_message": {
+ "name": "discord_archive_message",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(20)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "guild_id": {
+ "name": "guild_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "channel_id": {
+ "name": "channel_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author_discord_user_id": {
+ "name": "author_discord_user_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "author_label": {
+ "name": "author_label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "author_avatar_url": {
+ "name": "author_avatar_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "author_is_bot": {
+ "name": "author_is_bot",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "webhook_id": {
+ "name": "webhook_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "application_id": {
+ "name": "application_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message_type": {
+ "name": "message_type",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "edited_at": {
+ "name": "edited_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reply_to_message_id": {
+ "name": "reply_to_message_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "flags": {
+ "name": "flags",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'0'"
+ },
+ "mentions": {
+ "name": "mentions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{\"everyone\":false,\"roleIds\":[],\"userIds\":[]}'::jsonb"
+ },
+ "embeds": {
+ "name": "embeds",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "attachments": {
+ "name": "attachments",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "components": {
+ "name": "components",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "stickers": {
+ "name": "stickers",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "poll": {
+ "name": "poll",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ingested_at": {
+ "name": "ingested_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_observed_at": {
+ "name": "last_observed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "discord_archive_message_author_created_idx": {
+ "name": "discord_archive_message_author_created_idx",
+ "columns": [
+ {
+ "expression": "author_discord_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "discord_archive_message_channel_created_idx": {
+ "name": "discord_archive_message_channel_created_idx",
+ "columns": [
+ {
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "discord_archive_message_guild_created_idx": {
+ "name": "discord_archive_message_guild_created_idx",
+ "columns": [
+ {
+ "expression": "guild_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "discord_archive_message_non_deleted_created_idx": {
+ "name": "discord_archive_message_non_deleted_created_idx",
+ "columns": [
+ {
+ "expression": "guild_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"discord_archive_message\".\"deleted_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "discord_archive_message_channel_id_discord_archive_channel_id_fk": {
+ "name": "discord_archive_message_channel_id_discord_archive_channel_id_fk",
+ "tableFrom": "discord_archive_message",
+ "tableTo": "discord_archive_channel",
+ "columnsFrom": ["channel_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.discord_archive_state": {
+ "name": "discord_archive_state",
+ "schema": "",
+ "columns": {
+ "guild_id": {
+ "name": "guild_id",
+ "type": "varchar(20)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'idle'"
+ },
+ "last_gateway_event_at": {
+ "name": "last_gateway_event_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_live_write_at": {
+ "name": "last_live_write_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_discovery_started_at": {
+ "name": "last_discovery_started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_discovery_completed_at": {
+ "name": "last_discovery_completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_reconciliation_started_at": {
+ "name": "last_reconciliation_started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_reconciliation_completed_at": {
+ "name": "last_reconciliation_completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_backfill_progress_at": {
+ "name": "last_backfill_progress_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner": {
+ "name": "lease_owner",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error_code": {
+ "name": "last_error_code",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error_message": {
+ "name": "last_error_message",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_count": {
+ "name": "failure_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "discord_archive_state_status_check": {
+ "name": "discord_archive_state_status_check",
+ "value": "\"discord_archive_state\".\"status\" IN ('disabled', 'idle', 'healthy', 'degraded', 'failed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_alumni_bulletin_post": {
+ "name": "knight_hacks_alumni_bulletin_post",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image_object_name": {
+ "name": "image_object_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image_alt": {
+ "name": "image_alt",
+ "type": "varchar(240)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cta_label": {
+ "name": "cta_label",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_url": {
+ "name": "external_url",
+ "type": "varchar(2048)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "form_id": {
+ "name": "form_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "state": {
+ "name": "state",
+ "type": "alumni_bulletin_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "publish_at": {
+ "name": "publish_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_by_user_id": {
+ "name": "updated_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_alumni_bulletin_state_order_idx": {
+ "name": "knight_hacks_alumni_bulletin_state_order_idx",
+ "columns": [
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "display_order",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_alumni_bulletin_publication_window_idx": {
+ "name": "knight_hacks_alumni_bulletin_publication_window_idx",
+ "columns": [
+ {
+ "expression": "publish_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_alumni_bulletin_post_form_id_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_alumni_bulletin_post_form_id_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_alumni_bulletin_post",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_alumni_bulletin_post_created_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_alumni_bulletin_post_created_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_alumni_bulletin_post",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_alumni_bulletin_post_updated_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_alumni_bulletin_post_updated_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_alumni_bulletin_post",
+ "tableTo": "auth_user",
+ "columnsFrom": ["updated_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "alumni_bulletin_action_exclusive": {
+ "name": "alumni_bulletin_action_exclusive",
+ "value": "NOT (\"knight_hacks_alumni_bulletin_post\".\"external_url\" IS NOT NULL AND \"knight_hacks_alumni_bulletin_post\".\"form_id\" IS NOT NULL)"
+ },
+ "alumni_bulletin_action_pair": {
+ "name": "alumni_bulletin_action_pair",
+ "value": "((\"knight_hacks_alumni_bulletin_post\".\"external_url\" IS NULL AND \"knight_hacks_alumni_bulletin_post\".\"form_id\" IS NULL) OR \"knight_hacks_alumni_bulletin_post\".\"cta_label\" IS NOT NULL)"
+ },
+ "alumni_bulletin_display_order_nonnegative": {
+ "name": "alumni_bulletin_display_order_nonnegative",
+ "value": "\"knight_hacks_alumni_bulletin_post\".\"display_order\" >= 0"
+ },
+ "alumni_bulletin_image_alt_pair": {
+ "name": "alumni_bulletin_image_alt_pair",
+ "value": "((\"knight_hacks_alumni_bulletin_post\".\"image_object_name\" IS NULL AND \"knight_hacks_alumni_bulletin_post\".\"image_alt\" IS NULL) OR (\"knight_hacks_alumni_bulletin_post\".\"image_object_name\" IS NOT NULL AND \"knight_hacks_alumni_bulletin_post\".\"image_alt\" IS NOT NULL))"
+ },
+ "alumni_bulletin_schedule_order": {
+ "name": "alumni_bulletin_schedule_order",
+ "value": "\"knight_hacks_alumni_bulletin_post\".\"expires_at\" IS NULL OR \"knight_hacks_alumni_bulletin_post\".\"publish_at\" IS NULL OR \"knight_hacks_alumni_bulletin_post\".\"expires_at\" > \"knight_hacks_alumni_bulletin_post\".\"publish_at\""
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_company": {
+ "name": "knight_hacks_company",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "normalized_display_name": {
+ "name": "normalized_display_name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "legal_name": {
+ "name": "legal_name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "varchar(253)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "logo_object_name": {
+ "name": "logo_object_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "aliases": {
+ "name": "aliases",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "review_state": {
+ "name": "review_state",
+ "type": "company_review_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "merged_into_company_id": {
+ "name": "merged_into_company_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_company_review_state_idx": {
+ "name": "knight_hacks_company_review_state_idx",
+ "columns": [
+ {
+ "expression": "review_state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_company_domain_idx": {
+ "name": "knight_hacks_company_domain_idx",
+ "columns": [
+ {
+ "expression": "domain",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_company_created_by_user_idx": {
+ "name": "knight_hacks_company_created_by_user_idx",
+ "columns": [
+ {
+ "expression": "created_by_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_company_created_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_company_created_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_company",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_company_merged_into_fk": {
+ "name": "knight_hacks_company_merged_into_fk",
+ "tableFrom": "knight_hacks_company",
+ "tableTo": "knight_hacks_company",
+ "columnsFrom": ["merged_into_company_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_company_normalized_display_name_unique": {
+ "name": "knight_hacks_company_normalized_display_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["normalized_display_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_company_merged_state_consistency": {
+ "name": "knight_hacks_company_merged_state_consistency",
+ "value": "(\"knight_hacks_company\".\"review_state\" = 'merged') = (\"knight_hacks_company\".\"merged_into_company_id\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_dues_configuration": {
+ "name": "knight_hacks_dues_configuration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(32)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "payments_enabled": {
+ "name": "payments_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_dues_configuration_singleton_check": {
+ "name": "knight_hacks_dues_configuration_singleton_check",
+ "value": "\"knight_hacks_dues_configuration\".\"id\" = 'global'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_dues_payment": {
+ "name": "knight_hacks_dues_payment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "amount": {
+ "name": "amount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payment_date": {
+ "name": "payment_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "year": {
+ "name": "year",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "active": {
+ "name": "active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "stripe_payment_intent_id": {
+ "name": "stripe_payment_intent_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_dues_payment_member_id_knight_hacks_member_id_fk": {
+ "name": "knight_hacks_dues_payment_member_id_knight_hacks_member_id_fk",
+ "tableFrom": "knight_hacks_dues_payment",
+ "tableTo": "knight_hacks_member",
+ "columnsFrom": ["member_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_dues_payment_memberId_year_unique": {
+ "name": "knight_hacks_dues_payment_memberId_year_unique",
+ "nullsNotDistinct": false,
+ "columns": ["member_id", "year"]
+ },
+ "knight_hacks_dues_payment_stripe_payment_intent_id_unique": {
+ "name": "knight_hacks_dues_payment_stripe_payment_intent_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["stripe_payment_intent_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.email_send": {
+ "name": "email_send",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "subject": {
+ "name": "subject",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "template_revision_id": {
+ "name": "template_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "plain_text_source": {
+ "name": "plain_text_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compiled_html": {
+ "name": "compiled_html",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compiled_text": {
+ "name": "compiled_text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_hash": {
+ "name": "content_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "audience_definition": {
+ "name": "audience_definition",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "audience_version": {
+ "name": "audience_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "audience_hash": {
+ "name": "audience_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview_version": {
+ "name": "preview_version",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "preview_expires_at": {
+ "name": "preview_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "raw_match_count": {
+ "name": "raw_match_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "duplicate_count": {
+ "name": "duplicate_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "excluded_invalid_count": {
+ "name": "excluded_invalid_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "excluded_suppressed_count": {
+ "name": "excluded_suppressed_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "excluded_missing_field_count": {
+ "name": "excluded_missing_field_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "excluded_manual_count": {
+ "name": "excluded_manual_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "final_recipient_count": {
+ "name": "final_recipient_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "scheduled_for": {
+ "name": "scheduled_for",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "listmonk_list_id": {
+ "name": "listmonk_list_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "listmonk_campaign_id": {
+ "name": "listmonk_campaign_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider_tag": {
+ "name": "provider_tag",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_may_have_started": {
+ "name": "provider_may_have_started",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "provider_sent_count": {
+ "name": "provider_sent_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "provider_bounce_count": {
+ "name": "provider_bounce_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_attempt_count": {
+ "name": "retry_attempt_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "retry_lease_expires_at": {
+ "name": "retry_lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_retry_at": {
+ "name": "next_retry_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "safe_error": {
+ "name": "safe_error",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cancelled_at": {
+ "name": "cancelled_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cancelled_by": {
+ "name": "cancelled_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "terminal_at": {
+ "name": "terminal_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "email_send_status_scheduled_for_idx": {
+ "name": "email_send_status_scheduled_for_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "scheduled_for",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "email_send_retry_idx": {
+ "name": "email_send_retry_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "next_retry_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "retry_lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "email_send_template_revision_id_email_template_revision_id_fk": {
+ "name": "email_send_template_revision_id_email_template_revision_id_fk",
+ "tableFrom": "email_send",
+ "tableTo": "email_template_revision",
+ "columnsFrom": ["template_revision_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "email_send_created_by_auth_user_id_fk": {
+ "name": "email_send_created_by_auth_user_id_fk",
+ "tableFrom": "email_send",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "email_send_cancelled_by_auth_user_id_fk": {
+ "name": "email_send_cancelled_by_auth_user_id_fk",
+ "tableFrom": "email_send",
+ "tableTo": "auth_user",
+ "columnsFrom": ["cancelled_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "email_send_provider_tag_unique": {
+ "name": "email_send_provider_tag_unique",
+ "nullsNotDistinct": false,
+ "columns": ["provider_tag"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.email_send_event": {
+ "name": "email_send_event",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "send_id": {
+ "name": "send_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "from_status": {
+ "name": "from_status",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "to_status": {
+ "name": "to_status",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "email_send_event_send_created_idx": {
+ "name": "email_send_event_send_created_idx",
+ "columns": [
+ {
+ "expression": "send_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "email_send_event_send_id_email_send_id_fk": {
+ "name": "email_send_event_send_id_email_send_id_fk",
+ "tableFrom": "email_send_event",
+ "tableTo": "email_send",
+ "columnsFrom": ["send_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "email_send_event_actor_id_auth_user_id_fk": {
+ "name": "email_send_event_actor_id_auth_user_id_fk",
+ "tableFrom": "email_send_event",
+ "tableTo": "auth_user",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.email_send_recipient": {
+ "name": "email_send_recipient",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "send_id": {
+ "name": "send_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "normalized_email": {
+ "name": "normalized_email",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attributes": {
+ "name": "attributes",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "match_reasons": {
+ "name": "match_reasons",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "exclusion_reason": {
+ "name": "exclusion_reason",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "listmonk_subscriber_id": {
+ "name": "listmonk_subscriber_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "email_send_recipient_send_id_idx": {
+ "name": "email_send_recipient_send_id_idx",
+ "columns": [
+ {
+ "expression": "send_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "exclusion_reason",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "email_send_recipient_send_id_email_send_id_fk": {
+ "name": "email_send_recipient_send_id_email_send_id_fk",
+ "tableFrom": "email_send_recipient",
+ "tableTo": "email_send",
+ "columnsFrom": ["send_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "email_send_recipient_send_id_normalized_email_unique": {
+ "name": "email_send_recipient_send_id_normalized_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["send_id", "normalized_email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.email_template": {
+ "name": "email_template",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "normalized_name": {
+ "name": "normalized_name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'club'"
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "email_template_archived_updated_idx": {
+ "name": "email_template_archived_updated_idx",
+ "columns": [
+ {
+ "expression": "archived_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "email_template_created_by_auth_user_id_fk": {
+ "name": "email_template_created_by_auth_user_id_fk",
+ "tableFrom": "email_template",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "email_template_updated_by_auth_user_id_fk": {
+ "name": "email_template_updated_by_auth_user_id_fk",
+ "tableFrom": "email_template",
+ "tableTo": "auth_user",
+ "columnsFrom": ["updated_by"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "email_template_normalized_name_unique": {
+ "name": "email_template_normalized_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["normalized_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.email_template_revision": {
+ "name": "email_template_revision",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "template_id": {
+ "name": "template_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visual_document": {
+ "name": "visual_document",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compiled_html": {
+ "name": "compiled_html",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compiled_text": {
+ "name": "compiled_text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "personalization_contract": {
+ "name": "personalization_contract",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "checksum": {
+ "name": "checksum",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "email_template_revision_template_state_idx": {
+ "name": "email_template_revision_template_state_idx",
+ "columns": [
+ {
+ "expression": "template_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "email_template_revision_template_id_email_template_id_fk": {
+ "name": "email_template_revision_template_id_email_template_id_fk",
+ "tableFrom": "email_template_revision",
+ "tableTo": "email_template",
+ "columnsFrom": ["template_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "email_template_revision_created_by_auth_user_id_fk": {
+ "name": "email_template_revision_created_by_auth_user_id_fk",
+ "tableFrom": "email_template_revision",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "email_template_revision_template_version_unique": {
+ "name": "email_template_revision_template_version_unique",
+ "nullsNotDistinct": false,
+ "columns": ["template_id", "version"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_employment": {
+ "name": "knight_hacks_employment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "company_id": {
+ "name": "company_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "experience_type": {
+ "name": "experience_type",
+ "type": "employment_experience_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "state": {
+ "name": "state",
+ "type": "employment_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "start_month": {
+ "name": "start_month",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "end_month": {
+ "name": "end_month",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "city_key": {
+ "name": "city_key",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guild_visible": {
+ "name": "guild_visible",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_employment_member_idx": {
+ "name": "knight_hacks_employment_member_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_employment_company_idx": {
+ "name": "knight_hacks_employment_company_idx",
+ "columns": [
+ {
+ "expression": "company_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_employment_company_state_idx": {
+ "name": "knight_hacks_employment_company_state_idx",
+ "columns": [
+ {
+ "expression": "company_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_employment_member_id_knight_hacks_member_id_fk": {
+ "name": "knight_hacks_employment_member_id_knight_hacks_member_id_fk",
+ "tableFrom": "knight_hacks_employment",
+ "tableTo": "knight_hacks_member",
+ "columnsFrom": ["member_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_employment_company_id_knight_hacks_company_id_fk": {
+ "name": "knight_hacks_employment_company_id_knight_hacks_company_id_fk",
+ "tableFrom": "knight_hacks_employment",
+ "tableTo": "knight_hacks_company",
+ "columnsFrom": ["company_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_employment_current_has_no_end": {
+ "name": "knight_hacks_employment_current_has_no_end",
+ "value": "\"knight_hacks_employment\".\"state\" <> 'current' OR \"knight_hacks_employment\".\"end_month\" IS NULL"
+ },
+ "knight_hacks_employment_start_month_shape": {
+ "name": "knight_hacks_employment_start_month_shape",
+ "value": "\"knight_hacks_employment\".\"start_month\" IS NULL OR \"knight_hacks_employment\".\"start_month\" ~ '^[0-9]{4}-(0[1-9]|1[0-2])$'"
+ },
+ "knight_hacks_employment_end_month_shape": {
+ "name": "knight_hacks_employment_end_month_shape",
+ "value": "\"knight_hacks_employment\".\"end_month\" IS NULL OR \"knight_hacks_employment\".\"end_month\" ~ '^[0-9]{4}-(0[1-9]|1[0-2])$'"
+ },
+ "knight_hacks_employment_date_order": {
+ "name": "knight_hacks_employment_date_order",
+ "value": "\"knight_hacks_employment\".\"start_month\" IS NULL OR \"knight_hacks_employment\".\"end_month\" IS NULL OR \"knight_hacks_employment\".\"end_month\" >= \"knight_hacks_employment\".\"start_month\""
+ },
+ "knight_hacks_employment_city_key_shape": {
+ "name": "knight_hacks_employment_city_key_shape",
+ "value": "\"knight_hacks_employment\".\"city_key\" IS NULL OR \"knight_hacks_employment\".\"city_key\" ~ '^[0-9]{2}-[0-9]{5}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event": {
+ "name": "knight_hacks_event",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "discord_id": {
+ "name": "discord_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_id": {
+ "name": "google_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag": {
+ "name": "tag",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag_id": {
+ "name": "tag_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_color": {
+ "name": "tag_color",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'#0D9488'"
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "start_datetime": {
+ "name": "start_datetime",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_datetime": {
+ "name": "end_datetime",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "location": {
+ "name": "location",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "dues_paying": {
+ "name": "dues_paying",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_operations_calendar": {
+ "name": "is_operations_calendar",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "roles": {
+ "name": "roles",
+ "type": "varchar(255)[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "points": {
+ "name": "points",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "event_purpose",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'event'"
+ },
+ "discord_channel_id": {
+ "name": "discord_channel_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "legacy": {
+ "name": "legacy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "discord_sync_state": {
+ "name": "discord_sync_state",
+ "type": "event_sync_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'pending'"
+ },
+ "google_sync_state": {
+ "name": "google_sync_state",
+ "type": "event_sync_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'pending'"
+ },
+ "discord_last_error": {
+ "name": "discord_last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_last_error": {
+ "name": "google_last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deletion_intent_at": {
+ "name": "deletion_intent_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creation_key": {
+ "name": "creation_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creation_payload_hash": {
+ "name": "creation_payload_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_revision": {
+ "name": "sync_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "sync_lease_token": {
+ "name": "sync_lease_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_lease_expires_at": {
+ "name": "sync_lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_lease_revision": {
+ "name": "sync_lease_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_outbound_attempt_token": {
+ "name": "discord_outbound_attempt_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_outbound_attempted_at": {
+ "name": "discord_outbound_attempted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_outbound_attempt_revision": {
+ "name": "discord_outbound_attempt_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_outbound_attempt_token": {
+ "name": "google_outbound_attempt_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_outbound_attempted_at": {
+ "name": "google_outbound_attempted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_outbound_attempt_revision": {
+ "name": "google_outbound_attempt_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_applied_revision": {
+ "name": "discord_applied_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_applied_entity_type": {
+ "name": "discord_applied_entity_type",
+ "type": "event_discord_entity_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_applied_channel_id": {
+ "name": "discord_applied_channel_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_applied_revision": {
+ "name": "google_applied_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_applied_destination": {
+ "name": "google_applied_destination",
+ "type": "event_google_destination",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "google_applied_calendar_id": {
+ "name": "google_applied_calendar_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility_revision": {
+ "name": "visibility_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility_dues_paying": {
+ "name": "visibility_dues_paying",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility_roles": {
+ "name": "visibility_roles",
+ "type": "varchar(255)[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility_internal": {
+ "name": "visibility_internal",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_no_projection_acknowledged_at": {
+ "name": "discord_no_projection_acknowledged_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_no_projection_acknowledged_by": {
+ "name": "discord_no_projection_acknowledged_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_event_start_datetime_idx": {
+ "name": "knight_hacks_event_start_datetime_idx",
+ "columns": [
+ {
+ "expression": "start_datetime",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_hackathon_id_idx": {
+ "name": "knight_hacks_event_hackathon_id_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_one_primary_per_hackathon": {
+ "name": "knight_hacks_event_one_primary_per_hackathon",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_event\".\"purpose\" = 'primary_check_in'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_event_tag_id_knight_hacks_event_tag_id_fk": {
+ "name": "knight_hacks_event_tag_id_knight_hacks_event_tag_id_fk",
+ "tableFrom": "knight_hacks_event",
+ "tableTo": "knight_hacks_event_tag",
+ "columnsFrom": ["tag_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_event_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_event",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_discord_no_projection_acknowledged_by_auth_user_id_fk": {
+ "name": "knight_hacks_event_discord_no_projection_acknowledged_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_event",
+ "tableTo": "auth_user",
+ "columnsFrom": ["discord_no_projection_acknowledged_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_event_creationKey_unique": {
+ "name": "knight_hacks_event_creationKey_unique",
+ "nullsNotDistinct": false,
+ "columns": ["creation_key"]
+ },
+ "knight_hacks_event_id_hackathon_unique": {
+ "name": "knight_hacks_event_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_event_primary_requires_hackathon_check": {
+ "name": "knight_hacks_event_primary_requires_hackathon_check",
+ "value": "\"knight_hacks_event\".\"purpose\" <> 'primary_check_in' OR \"knight_hacks_event\".\"hackathon_id\" IS NOT NULL"
+ },
+ "knight_hacks_event_tag_color_check": {
+ "name": "knight_hacks_event_tag_color_check",
+ "value": "\"knight_hacks_event\".\"tag_color\" ~ '^#[0-9A-Fa-f]{6}$'"
+ },
+ "knight_hacks_event_sync_revision_check": {
+ "name": "knight_hacks_event_sync_revision_check",
+ "value": "\"knight_hacks_event\".\"sync_revision\" >= 0"
+ },
+ "knight_hacks_event_new_points_check": {
+ "name": "knight_hacks_event_new_points_check",
+ "value": "\"knight_hacks_event\".\"legacy\" OR (\"knight_hacks_event\".\"points\" IS NOT NULL AND \"knight_hacks_event\".\"points\" >= 0)"
+ },
+ "knight_hacks_event_nonlegacy_sync_states_check": {
+ "name": "knight_hacks_event_nonlegacy_sync_states_check",
+ "value": "\"knight_hacks_event\".\"legacy\" OR (\"knight_hacks_event\".\"discord_sync_state\" IS NOT NULL AND \"knight_hacks_event\".\"google_sync_state\" IS NOT NULL)"
+ },
+ "knight_hacks_event_creation_identity_pair_check": {
+ "name": "knight_hacks_event_creation_identity_pair_check",
+ "value": "(\"knight_hacks_event\".\"creation_key\" IS NULL) = (\"knight_hacks_event\".\"creation_payload_hash\" IS NULL)"
+ },
+ "knight_hacks_event_new_creation_identity_check": {
+ "name": "knight_hacks_event_new_creation_identity_check",
+ "value": "\"knight_hacks_event\".\"legacy\" OR (\"knight_hacks_event\".\"creation_key\" IS NOT NULL AND \"knight_hacks_event\".\"creation_payload_hash\" IS NOT NULL)"
+ },
+ "knight_hacks_event_sync_lease_set_check": {
+ "name": "knight_hacks_event_sync_lease_set_check",
+ "value": "(\"knight_hacks_event\".\"sync_lease_token\" IS NULL AND \"knight_hacks_event\".\"sync_lease_expires_at\" IS NULL AND \"knight_hacks_event\".\"sync_lease_revision\" IS NULL) OR (\"knight_hacks_event\".\"sync_lease_token\" IS NOT NULL AND \"knight_hacks_event\".\"sync_lease_expires_at\" IS NOT NULL AND \"knight_hacks_event\".\"sync_lease_revision\" IS NOT NULL)"
+ },
+ "knight_hacks_event_discord_attempt_set_check": {
+ "name": "knight_hacks_event_discord_attempt_set_check",
+ "value": "(\"knight_hacks_event\".\"discord_outbound_attempt_token\" IS NULL AND \"knight_hacks_event\".\"discord_outbound_attempted_at\" IS NULL AND \"knight_hacks_event\".\"discord_outbound_attempt_revision\" IS NULL) OR (\"knight_hacks_event\".\"discord_outbound_attempt_token\" IS NOT NULL AND \"knight_hacks_event\".\"discord_outbound_attempted_at\" IS NOT NULL AND \"knight_hacks_event\".\"discord_outbound_attempt_revision\" IS NOT NULL)"
+ },
+ "knight_hacks_event_google_attempt_set_check": {
+ "name": "knight_hacks_event_google_attempt_set_check",
+ "value": "(\"knight_hacks_event\".\"google_outbound_attempt_token\" IS NULL AND \"knight_hacks_event\".\"google_outbound_attempted_at\" IS NULL AND \"knight_hacks_event\".\"google_outbound_attempt_revision\" IS NULL) OR (\"knight_hacks_event\".\"google_outbound_attempt_token\" IS NOT NULL AND \"knight_hacks_event\".\"google_outbound_attempted_at\" IS NOT NULL AND \"knight_hacks_event\".\"google_outbound_attempt_revision\" IS NOT NULL)"
+ },
+ "knight_hacks_event_visibility_set_check": {
+ "name": "knight_hacks_event_visibility_set_check",
+ "value": "(\"knight_hacks_event\".\"visibility_revision\" IS NULL AND \"knight_hacks_event\".\"visibility_dues_paying\" IS NULL AND \"knight_hacks_event\".\"visibility_roles\" IS NULL AND \"knight_hacks_event\".\"visibility_internal\" IS NULL) OR (\"knight_hacks_event\".\"visibility_revision\" IS NOT NULL AND \"knight_hacks_event\".\"visibility_dues_paying\" IS NOT NULL AND \"knight_hacks_event\".\"visibility_roles\" IS NOT NULL AND \"knight_hacks_event\".\"visibility_internal\" IS NOT NULL)"
+ },
+ "knight_hacks_event_visibility_revision_check": {
+ "name": "knight_hacks_event_visibility_revision_check",
+ "value": "\"knight_hacks_event\".\"visibility_revision\" IS NULL OR \"knight_hacks_event\".\"visibility_revision\" <= \"knight_hacks_event\".\"sync_revision\""
+ },
+ "knight_hacks_event_discord_applied_revision_check": {
+ "name": "knight_hacks_event_discord_applied_revision_check",
+ "value": "\"knight_hacks_event\".\"discord_applied_revision\" IS NULL OR \"knight_hacks_event\".\"discord_applied_revision\" <= \"knight_hacks_event\".\"sync_revision\""
+ },
+ "knight_hacks_event_google_applied_revision_check": {
+ "name": "knight_hacks_event_google_applied_revision_check",
+ "value": "\"knight_hacks_event\".\"google_applied_revision\" IS NULL OR \"knight_hacks_event\".\"google_applied_revision\" <= \"knight_hacks_event\".\"sync_revision\""
+ },
+ "knight_hacks_event_discord_synced_state_check": {
+ "name": "knight_hacks_event_discord_synced_state_check",
+ "value": "\"knight_hacks_event\".\"discord_sync_state\" IS DISTINCT FROM 'synced' OR (\"knight_hacks_event\".\"discord_id\" IS NOT NULL AND \"knight_hacks_event\".\"discord_applied_revision\" IS NOT NULL AND \"knight_hacks_event\".\"discord_applied_revision\" = \"knight_hacks_event\".\"sync_revision\" AND \"knight_hacks_event\".\"discord_applied_entity_type\" IS NOT NULL AND ((\"knight_hacks_event\".\"discord_applied_entity_type\" = 'external' AND \"knight_hacks_event\".\"discord_applied_channel_id\" IS NULL) OR (\"knight_hacks_event\".\"discord_applied_entity_type\" IN ('voice', 'stage') AND \"knight_hacks_event\".\"discord_applied_channel_id\" IS NOT NULL)))"
+ },
+ "knight_hacks_event_google_synced_state_check": {
+ "name": "knight_hacks_event_google_synced_state_check",
+ "value": "\"knight_hacks_event\".\"google_sync_state\" IS DISTINCT FROM 'synced' OR (\"knight_hacks_event\".\"google_id\" IS NOT NULL AND \"knight_hacks_event\".\"google_applied_revision\" IS NOT NULL AND \"knight_hacks_event\".\"google_applied_revision\" = \"knight_hacks_event\".\"sync_revision\" AND \"knight_hacks_event\".\"google_applied_destination\" IS NOT NULL AND \"knight_hacks_event\".\"google_applied_calendar_id\" IS NOT NULL)"
+ },
+ "knight_hacks_event_published_visibility_check": {
+ "name": "knight_hacks_event_published_visibility_check",
+ "value": "\"knight_hacks_event\".\"published_at\" IS NULL OR (\"knight_hacks_event\".\"visibility_revision\" IS NOT NULL AND \"knight_hacks_event\".\"visibility_dues_paying\" IS NOT NULL AND \"knight_hacks_event\".\"visibility_roles\" IS NOT NULL AND \"knight_hacks_event\".\"visibility_internal\" IS NOT NULL)"
+ },
+ "knight_hacks_event_discord_acknowledgement_time_check": {
+ "name": "knight_hacks_event_discord_acknowledgement_time_check",
+ "value": "\"knight_hacks_event\".\"discord_no_projection_acknowledged_by\" IS NULL OR \"knight_hacks_event\".\"discord_no_projection_acknowledged_at\" IS NOT NULL"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event_attendee": {
+ "name": "knight_hacks_event_attendee",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_in_at": {
+ "name": "checked_in_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "checked_in_by": {
+ "name": "checked_in_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "points_awarded": {
+ "name": "points_awarded",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "points_awarded_estimated": {
+ "name": "points_awarded_estimated",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_event_attendee_event_member_idx": {
+ "name": "knight_hacks_event_attendee_event_member_idx",
+ "columns": [
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_attendee_member_event_idx": {
+ "name": "knight_hacks_event_attendee_member_event_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_event_attendee_member_id_knight_hacks_member_id_fk": {
+ "name": "knight_hacks_event_attendee_member_id_knight_hacks_member_id_fk",
+ "tableFrom": "knight_hacks_event_attendee",
+ "tableTo": "knight_hacks_member",
+ "columnsFrom": ["member_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_attendee_event_id_knight_hacks_event_id_fk": {
+ "name": "knight_hacks_event_attendee_event_id_knight_hacks_event_id_fk",
+ "tableFrom": "knight_hacks_event_attendee",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_attendee_checked_in_by_auth_user_id_fk": {
+ "name": "knight_hacks_event_attendee_checked_in_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_event_attendee",
+ "tableTo": "auth_user",
+ "columnsFrom": ["checked_in_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event_feedback": {
+ "name": "knight_hacks_event_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "overall_event_rating": {
+ "name": "overall_event_rating",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "fun_rating": {
+ "name": "fun_rating",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "learned_rating": {
+ "name": "learned_rating",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "heard_about_us": {
+ "name": "heard_about_us",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "additional_feedback": {
+ "name": "additional_feedback",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "similar_event": {
+ "name": "similar_event",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_event_feedback_member_id_knight_hacks_member_id_fk": {
+ "name": "knight_hacks_event_feedback_member_id_knight_hacks_member_id_fk",
+ "tableFrom": "knight_hacks_event_feedback",
+ "tableTo": "knight_hacks_member",
+ "columnsFrom": ["member_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_feedback_event_id_knight_hacks_event_id_fk": {
+ "name": "knight_hacks_event_feedback_event_id_knight_hacks_event_id_fk",
+ "tableFrom": "knight_hacks_event_feedback",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event_feedback_config": {
+ "name": "knight_hacks_event_feedback_config",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_id": {
+ "name": "form_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "closes_at": {
+ "name": "closes_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reward_points": {
+ "name": "reward_points",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 5
+ },
+ "template_revision": {
+ "name": "template_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "custom_questions": {
+ "name": "custom_questions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_event_feedback_config_event_id_knight_hacks_event_id_fk": {
+ "name": "knight_hacks_event_feedback_config_event_id_knight_hacks_event_id_fk",
+ "tableFrom": "knight_hacks_event_feedback_config",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_feedback_config_form_id_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_event_feedback_config_form_id_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_event_feedback_config",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_event_feedback_config_eventId_unique": {
+ "name": "knight_hacks_event_feedback_config_eventId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["event_id"]
+ },
+ "knight_hacks_event_feedback_config_formId_unique": {
+ "name": "knight_hacks_event_feedback_config_formId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["form_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_event_feedback_config_reward_check": {
+ "name": "knight_hacks_event_feedback_config_reward_check",
+ "value": "\"knight_hacks_event_feedback_config\".\"reward_points\" = 5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event_feedback_reward": {
+ "name": "knight_hacks_event_feedback_reward",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "points_awarded": {
+ "name": "points_awarded",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 5
+ },
+ "awarded_at": {
+ "name": "awarded_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_event_feedback_reward_event_id_knight_hacks_event_id_fk": {
+ "name": "knight_hacks_event_feedback_reward_event_id_knight_hacks_event_id_fk",
+ "tableFrom": "knight_hacks_event_feedback_reward",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_feedback_reward_member_id_knight_hacks_member_id_fk": {
+ "name": "knight_hacks_event_feedback_reward_member_id_knight_hacks_member_id_fk",
+ "tableFrom": "knight_hacks_event_feedback_reward",
+ "tableTo": "knight_hacks_member",
+ "columnsFrom": ["member_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_feedback_reward_response_id_knight_hacks_form_response_id_fk": {
+ "name": "knight_hacks_event_feedback_reward_response_id_knight_hacks_form_response_id_fk",
+ "tableFrom": "knight_hacks_event_feedback_reward",
+ "tableTo": "knight_hacks_form_response",
+ "columnsFrom": ["response_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_event_feedback_reward_event_member_unique": {
+ "name": "knight_hacks_event_feedback_reward_event_member_unique",
+ "nullsNotDistinct": false,
+ "columns": ["event_id", "member_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_event_feedback_reward_points_check": {
+ "name": "knight_hacks_event_feedback_reward_points_check",
+ "value": "\"knight_hacks_event_feedback_reward\".\"points_awarded\" = 5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event_publication_work": {
+ "name": "knight_hacks_event_publication_work",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "publication_id": {
+ "name": "publication_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "hackathon_event_publication_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_enabled": {
+ "name": "target_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_revision": {
+ "name": "event_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "publication_revision": {
+ "name": "publication_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "event_publication_work_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempt_count": {
+ "name": "attempt_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "next_attempt_at": {
+ "name": "next_attempt_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "last_attempt_at": {
+ "name": "last_attempt_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_token": {
+ "name": "lease_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_event_publication_work_due_idx": {
+ "name": "knight_hacks_event_publication_work_due_idx",
+ "columns": [
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "next_attempt_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_publication_work_health_idx": {
+ "name": "knight_hacks_event_publication_work_health_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_publication_work_lease_expiry_idx": {
+ "name": "knight_hacks_event_publication_work_lease_expiry_idx",
+ "columns": [
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_event_publication_work_scoped_publication_fk": {
+ "name": "knight_hacks_event_publication_work_scoped_publication_fk",
+ "tableFrom": "knight_hacks_event_publication_work",
+ "tableTo": "knight_hacks_hackathon_event_publication",
+ "columnsFrom": ["publication_id", "hackathon_id", "provider"],
+ "columnsTo": ["id", "hackathon_id", "provider"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_event_publication_work_scoped_event_fk": {
+ "name": "knight_hacks_event_publication_work_scoped_event_fk",
+ "tableFrom": "knight_hacks_event_publication_work",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_event_publication_work_event_provider_unique": {
+ "name": "knight_hacks_event_publication_work_event_provider_unique",
+ "nullsNotDistinct": false,
+ "columns": ["event_id", "provider"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_event_publication_work_attempt_count_check": {
+ "name": "knight_hacks_event_publication_work_attempt_count_check",
+ "value": "\"knight_hacks_event_publication_work\".\"attempt_count\" >= 0"
+ },
+ "knight_hacks_event_publication_work_revisions_check": {
+ "name": "knight_hacks_event_publication_work_revisions_check",
+ "value": "\"knight_hacks_event_publication_work\".\"event_revision\" >= 1 AND \"knight_hacks_event_publication_work\".\"publication_revision\" >= 1"
+ },
+ "knight_hacks_event_publication_work_lease_pair_check": {
+ "name": "knight_hacks_event_publication_work_lease_pair_check",
+ "value": "(\"knight_hacks_event_publication_work\".\"lease_token\" IS NULL) = (\"knight_hacks_event_publication_work\".\"lease_expires_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_event_tag": {
+ "name": "knight_hacks_event_tag",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "normalized_name": {
+ "name": "normalized_name",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_points": {
+ "name": "default_points",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "emoji": {
+ "name": "emoji",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "announcement_channel_id": {
+ "name": "announcement_channel_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "skip_next_week": {
+ "name": "skip_next_week",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "color": {
+ "name": "color",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "active": {
+ "name": "active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_event_tag_club_normalized_name_unique": {
+ "name": "knight_hacks_event_tag_club_normalized_name_unique",
+ "columns": [
+ {
+ "expression": "normalized_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_event_tag\".\"hackathon_id\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_tag_hackathon_normalized_name_unique": {
+ "name": "knight_hacks_event_tag_hackathon_normalized_name_unique",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "normalized_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_event_tag\".\"hackathon_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_event_tag_hackathon_idx": {
+ "name": "knight_hacks_event_tag_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_event_tag_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_event_tag_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_event_tag",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_event_tag_default_points_check": {
+ "name": "knight_hacks_event_tag_default_points_check",
+ "value": "\"knight_hacks_event_tag\".\"default_points\" >= 0"
+ },
+ "knight_hacks_event_tag_announcement_channel_check": {
+ "name": "knight_hacks_event_tag_announcement_channel_check",
+ "value": "\"knight_hacks_event_tag\".\"announcement_channel_id\" IS NULL OR \"knight_hacks_event_tag\".\"announcement_channel_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_event_tag_color_check": {
+ "name": "knight_hacks_event_tag_color_check",
+ "value": "\"knight_hacks_event_tag\".\"color\" ~ '^#[0-9A-Fa-f]{6}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_attachment": {
+ "name": "knight_hacks_form_attachment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "form_id": {
+ "name": "form_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "object_name": {
+ "name": "object_name",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "purpose": {
+ "name": "purpose",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'response'"
+ },
+ "finalized_at": {
+ "name": "finalized_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_form_attachment_form_idx": {
+ "name": "knight_hacks_form_attachment_form_idx",
+ "columns": [
+ {
+ "expression": "form_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_form_attachment_response_idx": {
+ "name": "knight_hacks_form_attachment_response_idx",
+ "columns": [
+ {
+ "expression": "response_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_form_attachment_form_id_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_form_attachment_form_id_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_form_attachment",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_attachment_response_id_knight_hacks_form_response_id_fk": {
+ "name": "knight_hacks_form_attachment_response_id_knight_hacks_form_response_id_fk",
+ "tableFrom": "knight_hacks_form_attachment",
+ "tableTo": "knight_hacks_form_response",
+ "columnsFrom": ["response_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_attachment_owner_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_form_attachment_owner_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_form_attachment",
+ "tableTo": "auth_user",
+ "columnsFrom": ["owner_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_form_attachment_objectName_unique": {
+ "name": "knight_hacks_form_attachment_objectName_unique",
+ "nullsNotDistinct": false,
+ "columns": ["object_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_form_attachment_purpose_check": {
+ "name": "knight_hacks_form_attachment_purpose_check",
+ "value": "\"knight_hacks_form_attachment\".\"purpose\" IN ('banner', 'instruction', 'response')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_callback_configuration": {
+ "name": "knight_hacks_form_callback_configuration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "form_id": {
+ "name": "form_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "callback_slug": {
+ "name": "callback_slug",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "active": {
+ "name": "active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "mappings": {
+ "name": "mappings",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_callback_configuration_form_id_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_form_callback_configuration_form_id_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_form_callback_configuration",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_form_callback_configuration_form_slug_unique": {
+ "name": "knight_hacks_form_callback_configuration_form_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": ["form_id", "callback_slug"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_callback_execution": {
+ "name": "knight_hacks_form_callback_execution",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "configuration_id": {
+ "name": "configuration_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "callback_slug": {
+ "name": "callback_slug",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "input": {
+ "name": "input",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "form_callback_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "available_at": {
+ "name": "available_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "lease_token": {
+ "name": "lease_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "succeeded_at": {
+ "name": "succeeded_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_form_callback_execution_status_available_idx": {
+ "name": "knight_hacks_form_callback_execution_status_available_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "available_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_form_callback_execution_configuration_id_knight_hacks_form_callback_configuration_id_fk": {
+ "name": "knight_hacks_form_callback_execution_configuration_id_knight_hacks_form_callback_configuration_id_fk",
+ "tableFrom": "knight_hacks_form_callback_execution",
+ "tableTo": "knight_hacks_form_callback_configuration",
+ "columnsFrom": ["configuration_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_callback_execution_response_id_knight_hacks_form_response_id_fk": {
+ "name": "knight_hacks_form_callback_execution_response_id_knight_hacks_form_response_id_fk",
+ "tableFrom": "knight_hacks_form_callback_execution",
+ "tableTo": "knight_hacks_form_response",
+ "columnsFrom": ["response_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_response": {
+ "name": "knight_hacks_form_response",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "form": {
+ "name": "form",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_data": {
+ "name": "response_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_revision": {
+ "name": "form_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "response_snapshot": {
+ "name": "response_snapshot",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "edited_at": {
+ "name": "edited_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_form_response_form_created_idx": {
+ "name": "knight_hacks_form_response_form_created_idx",
+ "columns": [
+ {
+ "expression": "form",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_form_response_user_created_idx": {
+ "name": "knight_hacks_form_response_user_created_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_form_response_form_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_form_response_form_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_form_response",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_response_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_form_response_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_form_response",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_response_roles": {
+ "name": "knight_hacks_form_response_roles",
+ "schema": "",
+ "columns": {
+ "form_id": {
+ "name": "form_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_response_roles_form_id_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_form_response_roles_form_id_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_form_response_roles",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_response_roles_role_id_auth_roles_id_fk": {
+ "name": "knight_hacks_form_response_roles_role_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_form_response_roles",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_form_response_roles_form_id_role_id_pk": {
+ "name": "knight_hacks_form_response_roles_form_id_role_id_pk",
+ "columns": ["form_id", "role_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_section_edit_role": {
+ "name": "knight_hacks_form_section_edit_role",
+ "schema": "",
+ "columns": {
+ "section_id": {
+ "name": "section_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_section_edit_role_section_id_knight_hacks_form_sections_id_fk": {
+ "name": "knight_hacks_form_section_edit_role_section_id_knight_hacks_form_sections_id_fk",
+ "tableFrom": "knight_hacks_form_section_edit_role",
+ "tableTo": "knight_hacks_form_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_section_edit_role_role_id_auth_roles_id_fk": {
+ "name": "knight_hacks_form_section_edit_role_role_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_form_section_edit_role",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_form_section_edit_role_section_id_role_id_pk": {
+ "name": "knight_hacks_form_section_edit_role_section_id_role_id_pk",
+ "columns": ["section_id", "role_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_section_roles": {
+ "name": "knight_hacks_form_section_roles",
+ "schema": "",
+ "columns": {
+ "section_id": {
+ "name": "section_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_section_roles_section_id_knight_hacks_form_sections_id_fk": {
+ "name": "knight_hacks_form_section_roles_section_id_knight_hacks_form_sections_id_fk",
+ "tableFrom": "knight_hacks_form_section_roles",
+ "tableTo": "knight_hacks_form_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_section_roles_role_id_auth_roles_id_fk": {
+ "name": "knight_hacks_form_section_roles_role_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_form_section_roles",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_form_section_roles_section_id_role_id_pk": {
+ "name": "knight_hacks_form_section_roles_section_id_role_id_pk",
+ "columns": ["section_id", "role_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_section_view_role": {
+ "name": "knight_hacks_form_section_view_role",
+ "schema": "",
+ "columns": {
+ "section_id": {
+ "name": "section_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_section_view_role_section_id_knight_hacks_form_sections_id_fk": {
+ "name": "knight_hacks_form_section_view_role_section_id_knight_hacks_form_sections_id_fk",
+ "tableFrom": "knight_hacks_form_section_view_role",
+ "tableTo": "knight_hacks_form_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_section_view_role_role_id_auth_roles_id_fk": {
+ "name": "knight_hacks_form_section_view_role_role_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_form_section_view_role",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_form_section_view_role_section_id_role_id_pk": {
+ "name": "knight_hacks_form_section_view_role_section_id_role_id_pk",
+ "columns": ["section_id", "role_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_sections": {
+ "name": "knight_hacks_form_sections",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_form_sections_name_unique": {
+ "name": "knight_hacks_form_sections_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_single_response_claim": {
+ "name": "knight_hacks_form_single_response_claim",
+ "schema": "",
+ "columns": {
+ "form_id": {
+ "name": "form_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_single_response_claim_form_id_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_form_single_response_claim_form_id_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_form_single_response_claim",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_single_response_claim_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_form_single_response_claim_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_form_single_response_claim",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_form_single_response_claim_response_id_knight_hacks_form_response_id_fk": {
+ "name": "knight_hacks_form_single_response_claim_response_id_knight_hacks_form_response_id_fk",
+ "tableFrom": "knight_hacks_form_single_response_claim",
+ "tableTo": "knight_hacks_form_response",
+ "columnsFrom": ["response_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_form_single_response_claim_form_id_user_id_pk": {
+ "name": "knight_hacks_form_single_response_claim_form_id_user_id_pk",
+ "columns": ["form_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "knight_hacks_form_single_response_claim_responseId_unique": {
+ "name": "knight_hacks_form_single_response_claim_responseId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["response_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_form_schemas": {
+ "name": "knight_hacks_form_schemas",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug_name": {
+ "name": "slug_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "kind": {
+ "name": "kind",
+ "type": "form_kind",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'general'"
+ },
+ "state": {
+ "name": "state",
+ "type": "form_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "opens_at": {
+ "name": "opens_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "closes_at": {
+ "name": "closes_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "manually_closed": {
+ "name": "manually_closed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "response_mode": {
+ "name": "response_mode",
+ "type": "form_response_mode",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'single_locked'"
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "dues_only": {
+ "name": "dues_only",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "allow_resubmission": {
+ "name": "allow_resubmission",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "allow_edit": {
+ "name": "allow_edit",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "form_data": {
+ "name": "form_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_validator_json": {
+ "name": "form_validator_json",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "section": {
+ "name": "section",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'General'"
+ },
+ "section_id": {
+ "name": "section_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_closed": {
+ "name": "is_closed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_form_schemas_section_id_knight_hacks_form_sections_id_fk": {
+ "name": "knight_hacks_form_schemas_section_id_knight_hacks_form_sections_id_fk",
+ "tableFrom": "knight_hacks_form_schemas",
+ "tableTo": "knight_hacks_form_sections",
+ "columnsFrom": ["section_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_form_schemas_slugName_unique": {
+ "name": "knight_hacks_form_schemas_slugName_unique",
+ "nullsNotDistinct": false,
+ "columns": ["slug_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_guest_judge_session": {
+ "name": "knight_hacks_guest_judge_session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_link_id": {
+ "name": "access_link_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "judge_id": {
+ "name": "judge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "char(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revoked_by_user_id": {
+ "name": "revoked_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revocation_reason": {
+ "name": "revocation_reason",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_guest_judge_session_access_link_idx": {
+ "name": "knight_hacks_guest_judge_session_access_link_idx",
+ "columns": [
+ {
+ "expression": "access_link_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_guest_judge_session_revoked_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_guest_judge_session_revoked_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_guest_judge_session",
+ "tableTo": "auth_user",
+ "columnsFrom": ["revoked_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_guest_judge_session_access_link_scope_fk": {
+ "name": "knight_hacks_guest_judge_session_access_link_scope_fk",
+ "tableFrom": "knight_hacks_guest_judge_session",
+ "tableTo": "knight_hacks_judging_room_access_link",
+ "columnsFrom": ["access_link_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_guest_judge_session_judge_scope_fk": {
+ "name": "knight_hacks_guest_judge_session_judge_scope_fk",
+ "tableFrom": "knight_hacks_guest_judge_session",
+ "tableTo": "knight_hacks_judge",
+ "columnsFrom": ["judge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_guest_judge_session_token_hash_unique": {
+ "name": "knight_hacks_guest_judge_session_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon": {
+ "name": "knight_hacks_hackathon",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "theme": {
+ "name": "theme",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "timezone": {
+ "name": "timezone",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'America/New_York'"
+ },
+ "application_url": {
+ "name": "application_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "store_catalog_visible": {
+ "name": "store_catalog_visible",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "store_open": {
+ "name": "store_open",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "store_location": {
+ "name": "store_location",
+ "type": "varchar(240)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "application_background_enabled": {
+ "name": "application_background_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "application_background_key": {
+ "name": "application_background_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email_template_enabled": {
+ "name": "email_template_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "email_template_key": {
+ "name": "email_template_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "application_open": {
+ "name": "application_open",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "application_deadline": {
+ "name": "application_deadline",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "confirmation_deadline": {
+ "name": "confirmation_deadline",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "start_date": {
+ "name": "start_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_date": {
+ "name": "end_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "confirmation_capacity": {
+ "name": "confirmation_capacity",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "general_hacker_discord_role_id": {
+ "name": "general_hacker_discord_role_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "event_announcement_channel_id": {
+ "name": "event_announcement_channel_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issue_reports_channel_id": {
+ "name": "issue_reports_channel_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "issue_reports_role_id": {
+ "name": "issue_reports_role_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_name_unique": {
+ "name": "knight_hacks_hackathon_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_issue_reports_channel_id_check": {
+ "name": "knight_hacks_hackathon_issue_reports_channel_id_check",
+ "value": "\"knight_hacks_hackathon\".\"issue_reports_channel_id\" IS NULL OR \"knight_hacks_hackathon\".\"issue_reports_channel_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_issue_reports_role_id_check": {
+ "name": "knight_hacks_hackathon_issue_reports_role_id_check",
+ "value": "\"knight_hacks_hackathon\".\"issue_reports_role_id\" IS NULL OR \"knight_hacks_hackathon\".\"issue_reports_role_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_event_announcement_channel_id_check": {
+ "name": "knight_hacks_hackathon_event_announcement_channel_id_check",
+ "value": "\"knight_hacks_hackathon\".\"event_announcement_channel_id\" IS NULL OR \"knight_hacks_hackathon\".\"event_announcement_channel_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_general_hacker_discord_role_id_check": {
+ "name": "knight_hacks_hackathon_general_hacker_discord_role_id_check",
+ "value": "\"knight_hacks_hackathon\".\"general_hacker_discord_role_id\" IS NULL OR \"knight_hacks_hackathon\".\"general_hacker_discord_role_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_confirmation_capacity_check": {
+ "name": "knight_hacks_hackathon_confirmation_capacity_check",
+ "value": "\"knight_hacks_hackathon\".\"confirmation_capacity\" IS NULL OR \"knight_hacks_hackathon\".\"confirmation_capacity\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_agreement_definition": {
+ "name": "knight_hacks_hackathon_agreement_definition",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stage": {
+ "name": "stage",
+ "type": "hacker_agreement_stage",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key": {
+ "name": "key",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "legal_text": {
+ "name": "legal_text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "required": {
+ "name": "required",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "active": {
+ "name": "active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hackathon_agreement_definition_active_unique": {
+ "name": "knight_hacks_hackathon_agreement_definition_active_unique",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "stage",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_hackathon_agreement_definition\".\"active\" = true",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hackathon_agreement_definition_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_agreement_definition_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_agreement_definition",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_agreement_definition_created_by_auth_user_id_fk": {
+ "name": "knight_hacks_hackathon_agreement_definition_created_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hackathon_agreement_definition",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_agreement_definition_version_unique": {
+ "name": "knight_hacks_hackathon_agreement_definition_version_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id", "stage", "key", "version"]
+ },
+ "knight_hacks_hackathon_agreement_definition_id_hackathon_unique": {
+ "name": "knight_hacks_hackathon_agreement_definition_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_agreement_definition_content_check": {
+ "name": "knight_hacks_hackathon_agreement_definition_content_check",
+ "value": "\"knight_hacks_hackathon_agreement_definition\".\"legal_text\" IS NOT NULL OR \"knight_hacks_hackathon_agreement_definition\".\"url\" IS NOT NULL"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_class": {
+ "name": "knight_hacks_hackathon_class",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "discord_role_id": {
+ "name": "discord_role_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "knight_hacks_hackathon_class_hackathon_idx": {
+ "name": "knight_hacks_hackathon_class_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hackathon_class_one_vip_per_hackathon": {
+ "name": "knight_hacks_hackathon_class_one_vip_per_hackathon",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_hackathon_class\".\"kind\" = 'vip'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hackathon_class_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_class_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_class",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_class_id_hackathon_unique": {
+ "name": "knight_hacks_hackathon_class_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_class_discord_role_id_check": {
+ "name": "knight_hacks_hackathon_class_discord_role_id_check",
+ "value": "\"knight_hacks_hackathon_class\".\"discord_role_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_class_color_check": {
+ "name": "knight_hacks_hackathon_class_color_check",
+ "value": "\"knight_hacks_hackathon_class\".\"color\" ~ '^#[0-9a-fA-F]{6}$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_event_publication": {
+ "name": "knight_hacks_hackathon_event_publication",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider": {
+ "name": "provider",
+ "type": "hackathon_event_publication_provider",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "desired_enabled": {
+ "name": "desired_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "requested_at": {
+ "name": "requested_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "requested_by": {
+ "name": "requested_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_reconciled_at": {
+ "name": "last_reconciled_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_converged_at": {
+ "name": "last_converged_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hackathon_event_publication_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_event_publication_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_event_publication",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_event_publication_requested_by_auth_user_id_fk": {
+ "name": "knight_hacks_hackathon_event_publication_requested_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hackathon_event_publication",
+ "tableTo": "auth_user",
+ "columnsFrom": ["requested_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_event_publication_provider_unique": {
+ "name": "knight_hacks_hackathon_event_publication_provider_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id", "provider"]
+ },
+ "knight_hacks_hackathon_event_publication_id_scope_unique": {
+ "name": "knight_hacks_hackathon_event_publication_id_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id", "provider"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_event_publication_revision_check": {
+ "name": "knight_hacks_hackathon_event_publication_revision_check",
+ "value": "\"knight_hacks_hackathon_event_publication\".\"revision\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_event_reminder_delivery": {
+ "name": "knight_hacks_hackathon_event_reminder_delivery",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_start_at": {
+ "name": "event_start_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reminder_key": {
+ "name": "reminder_key",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "destination_channel_id_snapshot": {
+ "name": "destination_channel_id_snapshot",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id_snapshot": {
+ "name": "role_id_snapshot",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "discord_event_id_snapshot": {
+ "name": "discord_event_id_snapshot",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content_snapshot": {
+ "name": "content_snapshot",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "hackathon_event_reminder_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempt_count": {
+ "name": "attempt_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "locked_at": {
+ "name": "locked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_attempt_at": {
+ "name": "next_attempt_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivered_at": {
+ "name": "delivered_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_hackathon_event_reminder_delivery_pending_idx": {
+ "name": "knight_hacks_hackathon_event_reminder_delivery_pending_idx",
+ "columns": [
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "next_attempt_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hackathon_event_reminder_scoped_event_fk": {
+ "name": "knight_hacks_hackathon_event_reminder_scoped_event_fk",
+ "tableFrom": "knight_hacks_hackathon_event_reminder_delivery",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_event_reminder_delivery_identity_unique": {
+ "name": "knight_hacks_hackathon_event_reminder_delivery_identity_unique",
+ "nullsNotDistinct": false,
+ "columns": ["event_id", "reminder_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_event_reminder_channel_id_check": {
+ "name": "knight_hacks_hackathon_event_reminder_channel_id_check",
+ "value": "\"knight_hacks_hackathon_event_reminder_delivery\".\"destination_channel_id_snapshot\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_event_reminder_role_id_check": {
+ "name": "knight_hacks_hackathon_event_reminder_role_id_check",
+ "value": "\"knight_hacks_hackathon_event_reminder_delivery\".\"role_id_snapshot\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hackathon_event_reminder_attempt_count_check": {
+ "name": "knight_hacks_hackathon_event_reminder_attempt_count_check",
+ "value": "\"knight_hacks_hackathon_event_reminder_delivery\".\"attempt_count\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_judging_configuration": {
+ "name": "knight_hacks_hackathon_judging_configuration",
+ "schema": "",
+ "columns": {
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "hacker_schedule_published": {
+ "name": "hacker_schedule_published",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "hacker_schedule_emergency": {
+ "name": "hacker_schedule_emergency",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "project_claims_started_at": {
+ "name": "project_claims_started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_claim_url": {
+ "name": "project_claim_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "challenge_groups_initialized_at": {
+ "name": "challenge_groups_initialized_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_inventory_locked_at": {
+ "name": "project_inventory_locked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_inventory_locked_by_user_id": {
+ "name": "project_inventory_locked_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "state": {
+ "name": "state",
+ "type": "judging_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "display_all_results_to_members": {
+ "name": "display_all_results_to_members",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "judging_comms_channel_id": {
+ "name": "judging_comms_channel_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "opened_at": {
+ "name": "opened_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "closed_at": {
+ "name": "closed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hackathon_judging_configuration_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_judging_configuration_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_judging_configuration",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_judging_configuration_project_inventory_locked_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_hackathon_judging_configuration_project_inventory_locked_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hackathon_judging_configuration",
+ "tableTo": "auth_user",
+ "columnsFrom": ["project_inventory_locked_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_map_configuration": {
+ "name": "knight_hacks_hackathon_map_configuration",
+ "schema": "",
+ "columns": {
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "restrictions_enabled": {
+ "name": "restrictions_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "rooms": {
+ "name": "rooms",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hackathon_map_configuration_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_map_configuration_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_map_configuration",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_portal_authorization_code": {
+ "name": "knight_hacks_hackathon_portal_authorization_code",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "portal_client_id": {
+ "name": "portal_client_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "better_auth_session_id": {
+ "name": "better_auth_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_hash": {
+ "name": "code_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge": {
+ "name": "code_challenge",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code_challenge_method": {
+ "name": "code_challenge_method",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'S256'"
+ },
+ "redirect_uri": {
+ "name": "redirect_uri",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "consumed_at": {
+ "name": "consumed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_hackathon_portal_authorization_code_expiry_idx": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_expiry_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hackathon_portal_authorization_code_client_expiry_idx": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_client_expiry_idx",
+ "columns": [
+ {
+ "expression": "portal_client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hackathon_portal_authorization_code_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_authorization_code",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_portal_authorization_code_better_auth_session_id_auth_session_id_fk": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_better_auth_session_id_auth_session_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_authorization_code",
+ "tableTo": "auth_session",
+ "columnsFrom": ["better_auth_session_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_portal_authorization_code_scoped_client_fk": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_scoped_client_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_authorization_code",
+ "tableTo": "knight_hacks_hackathon_portal_client",
+ "columnsFrom": ["portal_client_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_portal_authorization_code_hash_unique": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["code_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_portal_authorization_code_hash_check": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_hash_check",
+ "value": "\"knight_hacks_hackathon_portal_authorization_code\".\"code_hash\" ~ '^[0-9a-f]{64}$'"
+ },
+ "knight_hacks_hackathon_portal_authorization_code_method_check": {
+ "name": "knight_hacks_hackathon_portal_authorization_code_method_check",
+ "value": "\"knight_hacks_hackathon_portal_authorization_code\".\"code_challenge_method\" = 'S256'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_portal_client": {
+ "name": "knight_hacks_hackathon_portal_client",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "production_origin": {
+ "name": "production_origin",
+ "type": "varchar(2048)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hackathon_portal_client_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_portal_client_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_client",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_portal_client_created_by_auth_user_id_fk": {
+ "name": "knight_hacks_hackathon_portal_client_created_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_client",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_portal_client_client_id_unique": {
+ "name": "knight_hacks_hackathon_portal_client_client_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["client_id"]
+ },
+ "knight_hacks_hackathon_portal_client_hackathon_unique": {
+ "name": "knight_hacks_hackathon_portal_client_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id"]
+ },
+ "knight_hacks_hackathon_portal_client_origin_unique": {
+ "name": "knight_hacks_hackathon_portal_client_origin_unique",
+ "nullsNotDistinct": false,
+ "columns": ["production_origin"]
+ },
+ "knight_hacks_hackathon_portal_client_id_hackathon_unique": {
+ "name": "knight_hacks_hackathon_portal_client_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_portal_client_origin_check": {
+ "name": "knight_hacks_hackathon_portal_client_origin_check",
+ "value": "\"knight_hacks_hackathon_portal_client\".\"production_origin\" ~ '^https://[a-z0-9-]+([.][a-z0-9-]+)*[.]knighthacks[.]org$'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_portal_session": {
+ "name": "knight_hacks_hackathon_portal_session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "portal_client_id": {
+ "name": "portal_client_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "better_auth_session_id": {
+ "name": "better_auth_session_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token_hash": {
+ "name": "access_token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_token_hash": {
+ "name": "refresh_token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_expires_at": {
+ "name": "access_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_expires_at": {
+ "name": "refresh_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_version": {
+ "name": "refresh_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_used_at": {
+ "name": "last_used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_hackathon_portal_session_access_expiry_idx": {
+ "name": "knight_hacks_hackathon_portal_session_access_expiry_idx",
+ "columns": [
+ {
+ "expression": "access_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "revoked_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hackathon_portal_session_refresh_expiry_idx": {
+ "name": "knight_hacks_hackathon_portal_session_refresh_expiry_idx",
+ "columns": [
+ {
+ "expression": "refresh_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hackathon_portal_session_user_client_idx": {
+ "name": "knight_hacks_hackathon_portal_session_user_client_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "portal_client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hackathon_portal_session_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_hackathon_portal_session_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_session",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_portal_session_better_auth_session_id_auth_session_id_fk": {
+ "name": "knight_hacks_hackathon_portal_session_better_auth_session_id_auth_session_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_session",
+ "tableTo": "auth_session",
+ "columnsFrom": ["better_auth_session_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_portal_session_scoped_client_fk": {
+ "name": "knight_hacks_hackathon_portal_session_scoped_client_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_session",
+ "tableTo": "knight_hacks_hackathon_portal_client",
+ "columnsFrom": ["portal_client_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_portal_session_access_hash_unique": {
+ "name": "knight_hacks_hackathon_portal_session_access_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["access_token_hash"]
+ },
+ "knight_hacks_hackathon_portal_session_refresh_hash_unique": {
+ "name": "knight_hacks_hackathon_portal_session_refresh_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["refresh_token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_portal_session_access_hash_check": {
+ "name": "knight_hacks_hackathon_portal_session_access_hash_check",
+ "value": "\"knight_hacks_hackathon_portal_session\".\"access_token_hash\" ~ '^[0-9a-f]{64}$'"
+ },
+ "knight_hacks_hackathon_portal_session_refresh_hash_check": {
+ "name": "knight_hacks_hackathon_portal_session_refresh_hash_check",
+ "value": "\"knight_hacks_hackathon_portal_session\".\"refresh_token_hash\" ~ '^[0-9a-f]{64}$'"
+ },
+ "knight_hacks_hackathon_portal_session_refresh_version_check": {
+ "name": "knight_hacks_hackathon_portal_session_refresh_version_check",
+ "value": "\"knight_hacks_hackathon_portal_session\".\"refresh_version\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_portal_session_credential": {
+ "name": "knight_hacks_hackathon_portal_session_credential",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "portal_session_id": {
+ "name": "portal_session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_kind": {
+ "name": "token_kind",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rotated_at": {
+ "name": "rotated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_hackathon_portal_session_credential_session_idx": {
+ "name": "knight_hacks_hackathon_portal_session_credential_session_idx",
+ "columns": [
+ {
+ "expression": "portal_session_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hackathon_portal_session_credential_portal_session_id_knight_hacks_hackathon_portal_session_id_fk": {
+ "name": "knight_hacks_hackathon_portal_session_credential_portal_session_id_knight_hacks_hackathon_portal_session_id_fk",
+ "tableFrom": "knight_hacks_hackathon_portal_session_credential",
+ "tableTo": "knight_hacks_hackathon_portal_session",
+ "columnsFrom": ["portal_session_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_portal_session_credential_hash_unique": {
+ "name": "knight_hacks_hackathon_portal_session_credential_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_portal_session_credential_hash_check": {
+ "name": "knight_hacks_hackathon_portal_session_credential_hash_check",
+ "value": "\"knight_hacks_hackathon_portal_session_credential\".\"token_hash\" ~ '^[0-9a-f]{64}$'"
+ },
+ "knight_hacks_hackathon_portal_session_credential_kind_check": {
+ "name": "knight_hacks_hackathon_portal_session_credential_kind_check",
+ "value": "\"knight_hacks_hackathon_portal_session_credential\".\"token_kind\" IN ('access', 'refresh')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_sponsor": {
+ "name": "knight_hacks_hackathon_sponsor",
+ "schema": "",
+ "columns": {
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sponsor_id": {
+ "name": "sponsor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tier": {
+ "name": "tier",
+ "type": "sponsor_tier",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hackathon_sponsor_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_sponsor_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_sponsor",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_sponsor_sponsor_id_knight_hacks_sponsor_id_fk": {
+ "name": "knight_hacks_hackathon_sponsor_sponsor_id_knight_hacks_sponsor_id_fk",
+ "tableFrom": "knight_hacks_hackathon_sponsor",
+ "tableTo": "knight_hacks_sponsor",
+ "columnsFrom": ["sponsor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hackathon_status_email": {
+ "name": "knight_hacks_hackathon_status_email",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "template_id": {
+ "name": "template_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "subject": {
+ "name": "subject",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hackathon_status_email_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hackathon_status_email_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hackathon_status_email",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hackathon_status_email_template_id_email_template_id_fk": {
+ "name": "knight_hacks_hackathon_status_email_template_id_email_template_id_fk",
+ "tableFrom": "knight_hacks_hackathon_status_email",
+ "tableTo": "email_template",
+ "columnsFrom": ["template_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hackathon_status_email_hackathon_status_unique": {
+ "name": "knight_hacks_hackathon_status_email_hackathon_status_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id", "status"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hackathon_status_email_status_check": {
+ "name": "knight_hacks_hackathon_status_email_status_check",
+ "value": "\"knight_hacks_hackathon_status_email\".\"status\" <> 'checkedin'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker": {
+ "name": "knight_hacks_hacker",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "first_name": {
+ "name": "first_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_name": {
+ "name": "last_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "gender": {
+ "name": "gender",
+ "type": "gender",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Prefer not to answer'"
+ },
+ "discord_user": {
+ "name": "discord_user",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "age": {
+ "name": "age",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "country": {
+ "name": "country",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'United States of America'"
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "phone_number": {
+ "name": "phone_number",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "school": {
+ "name": "school",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "level_of_study": {
+ "name": "level_of_study",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "major": {
+ "name": "major",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Computer Science'"
+ },
+ "race_or_ethnicity": {
+ "name": "race_or_ethnicity",
+ "type": "race_or_ethnicity",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Prefer not to answer'"
+ },
+ "shirt_size": {
+ "name": "shirt_size",
+ "type": "shirt_size",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_profile_url": {
+ "name": "github_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "linkedin_profile_url": {
+ "name": "linkedin_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website_url": {
+ "name": "website_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resume_url": {
+ "name": "resume_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dob": {
+ "name": "dob",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grad_date": {
+ "name": "grad_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "survey_1": {
+ "name": "survey_1",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "survey_2": {
+ "name": "survey_2",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_first_time": {
+ "name": "is_first_time",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "food_allergies": {
+ "name": "food_allergies",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agrees_to_receive_emails_from_mlh": {
+ "name": "agrees_to_receive_emails_from_mlh",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "agrees_to_mlh_code_of_conduct": {
+ "name": "agrees_to_mlh_code_of_conduct",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "agrees_to_mlh_data_sharing": {
+ "name": "agrees_to_mlh_data_sharing",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "date_created": {
+ "name": "date_created",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "time_created": {
+ "name": "time_created",
+ "type": "time",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hacker_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_agreement_acceptance": {
+ "name": "knight_hacks_hacker_agreement_acceptance",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "attendee_id": {
+ "name": "attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "agreement_definition_id": {
+ "name": "agreement_definition_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "accepted": {
+ "name": "accepted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provenance": {
+ "name": "provenance",
+ "type": "hacker_agreement_provenance",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'explicit'"
+ },
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "recorded_at": {
+ "name": "recorded_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_agreement_acceptance_attendee_idx": {
+ "name": "knight_hacks_hacker_agreement_acceptance_attendee_idx",
+ "columns": [
+ {
+ "expression": "attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_agreement_acceptance_scoped_attendee_fk": {
+ "name": "knight_hacks_hacker_agreement_acceptance_scoped_attendee_fk",
+ "tableFrom": "knight_hacks_hacker_agreement_acceptance",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_agreement_acceptance_scoped_definition_fk": {
+ "name": "knight_hacks_hacker_agreement_acceptance_scoped_definition_fk",
+ "tableFrom": "knight_hacks_hacker_agreement_acceptance",
+ "tableTo": "knight_hacks_hackathon_agreement_definition",
+ "columnsFrom": ["agreement_definition_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_agreement_acceptance_attendee_definition_unique": {
+ "name": "knight_hacks_hacker_agreement_acceptance_attendee_definition_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attendee_id", "agreement_definition_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_agreement_acceptance_timestamp_check": {
+ "name": "knight_hacks_hacker_agreement_acceptance_timestamp_check",
+ "value": "(\"knight_hacks_hacker_agreement_acceptance\".\"accepted\" = true AND \"knight_hacks_hacker_agreement_acceptance\".\"accepted_at\" IS NOT NULL) OR (\"knight_hacks_hacker_agreement_acceptance\".\"accepted\" = false AND \"knight_hacks_hacker_agreement_acceptance\".\"accepted_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_attendee": {
+ "name": "knight_hacks_hacker_attendee",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hacker_id": {
+ "name": "hacker_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "profile_revision_id": {
+ "name": "profile_revision_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "time_applied": {
+ "name": "time_applied",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "time_confirmed": {
+ "name": "time_confirmed",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "points": {
+ "name": "points",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "class_id": {
+ "name": "class_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_vip": {
+ "name": "is_vip",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_first_time": {
+ "name": "is_first_time",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "survey1": {
+ "name": "survey1",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "survey2": {
+ "name": "survey2",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "checked_in_at": {
+ "name": "checked_in_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "checked_in_by": {
+ "name": "checked_in_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "class": {
+ "name": "class",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": null
+ },
+ "blacklisted_at": {
+ "name": "blacklisted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "blacklisted_by": {
+ "name": "blacklisted_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "blacklist_reason": {
+ "name": "blacklist_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_status_send_id": {
+ "name": "last_status_send_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_attendee_class_idx": {
+ "name": "knight_hacks_hacker_attendee_class_idx",
+ "columns": [
+ {
+ "expression": "class_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_hackathon_class_idx": {
+ "name": "knight_hacks_hacker_attendee_hackathon_class_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "class_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_checked_in_by_idx": {
+ "name": "knight_hacks_hacker_attendee_checked_in_by_idx",
+ "columns": [
+ {
+ "expression": "checked_in_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_hackathon_checked_in_idx": {
+ "name": "knight_hacks_hacker_attendee_hackathon_checked_in_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "checked_in_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_profile_hackathon_unique": {
+ "name": "knight_hacks_hacker_attendee_profile_hackathon_unique",
+ "columns": [
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_hacker_attendee\".\"profile_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_profile_idx": {
+ "name": "knight_hacks_hacker_attendee_profile_idx",
+ "columns": [
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_profile_revision_idx": {
+ "name": "knight_hacks_hacker_attendee_profile_revision_idx",
+ "columns": [
+ {
+ "expression": "profile_revision_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_hackathon_status_idx": {
+ "name": "knight_hacks_hacker_attendee_hackathon_status_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_blacklisted_by_idx": {
+ "name": "knight_hacks_hacker_attendee_blacklisted_by_idx",
+ "columns": [
+ {
+ "expression": "blacklisted_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_attendee_last_status_send_idx": {
+ "name": "knight_hacks_hacker_attendee_last_status_send_idx",
+ "columns": [
+ {
+ "expression": "last_status_send_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_attendee_hacker_id_knight_hacks_hacker_id_fk": {
+ "name": "knight_hacks_hacker_attendee_hacker_id_knight_hacks_hacker_id_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "knight_hacks_hacker",
+ "columnsFrom": ["hacker_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_profile_id_knight_hacks_hacker_profile_id_fk": {
+ "name": "knight_hacks_hacker_attendee_profile_id_knight_hacks_hacker_profile_id_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "knight_hacks_hacker_profile",
+ "columnsFrom": ["profile_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hacker_attendee_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_checked_in_by_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_attendee_checked_in_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "auth_user",
+ "columnsFrom": ["checked_in_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_blacklisted_by_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_attendee_blacklisted_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "auth_user",
+ "columnsFrom": ["blacklisted_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_last_status_send_id_email_send_id_fk": {
+ "name": "knight_hacks_hacker_attendee_last_status_send_id_email_send_id_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "email_send",
+ "columnsFrom": ["last_status_send_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_scoped_class_fk": {
+ "name": "knight_hacks_hacker_attendee_scoped_class_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "knight_hacks_hackathon_class",
+ "columnsFrom": ["class_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_attendee_scoped_profile_revision_fk": {
+ "name": "knight_hacks_hacker_attendee_scoped_profile_revision_fk",
+ "tableFrom": "knight_hacks_hacker_attendee",
+ "tableTo": "knight_hacks_hacker_profile_revision",
+ "columnsFrom": ["profile_revision_id", "profile_id"],
+ "columnsTo": ["id", "profile_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_attendee_hacker_hackathon_unique": {
+ "name": "knight_hacks_hacker_attendee_hacker_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hacker_id", "hackathon_id"]
+ },
+ "knight_hacks_hacker_attendee_id_hackathon_unique": {
+ "name": "knight_hacks_hacker_attendee_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_attendee_blacklist_reason_check": {
+ "name": "knight_hacks_hacker_attendee_blacklist_reason_check",
+ "value": "(\"knight_hacks_hacker_attendee\".\"blacklisted_at\" is null and \"knight_hacks_hacker_attendee\".\"blacklist_reason\" is null)\n or (\"knight_hacks_hacker_attendee\".\"blacklisted_at\" is not null and \"knight_hacks_hacker_attendee\".\"blacklist_reason\" is not null)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_check_in_attempt": {
+ "name": "knight_hacks_hacker_check_in_attempt",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hacker_attendee_id": {
+ "name": "hacker_attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attendance_id": {
+ "name": "attendance_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "operator_id": {
+ "name": "operator_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "operator_display_name_snapshot": {
+ "name": "operator_display_name_snapshot",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mode": {
+ "name": "mode",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "outcome": {
+ "name": "outcome",
+ "type": "hacker_check_in_outcome",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_purpose": {
+ "name": "event_purpose",
+ "type": "event_purpose",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_name_snapshot": {
+ "name": "event_name_snapshot",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hacker_name_snapshot": {
+ "name": "hacker_name_snapshot",
+ "type": "varchar(511)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "class_id": {
+ "name": "class_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "class_name_snapshot": {
+ "name": "class_name_snapshot",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "class_color_snapshot": {
+ "name": "class_color_snapshot",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_vip_snapshot": {
+ "name": "is_vip_snapshot",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "was_minor_at_attempt": {
+ "name": "was_minor_at_attempt",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_repeat_occurrence": {
+ "name": "is_repeat_occurrence",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "points_awarded": {
+ "name": "points_awarded",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "attempted_at": {
+ "name": "attempted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_check_in_attempt_hackathon_history_idx": {
+ "name": "knight_hacks_hacker_check_in_attempt_hackathon_history_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "attempted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_check_in_attempt_attendee_history_idx": {
+ "name": "knight_hacks_hacker_check_in_attempt_attendee_history_idx",
+ "columns": [
+ {
+ "expression": "hacker_attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "attempted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_check_in_attempt_expiring_idx": {
+ "name": "knight_hacks_hacker_check_in_attempt_expiring_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"knight_hacks_hacker_check_in_attempt\".\"expires_at\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_check_in_attempt_operator_id_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_check_in_attempt_operator_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_check_in_attempt",
+ "tableTo": "auth_user",
+ "columnsFrom": ["operator_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_check_in_attempt_scoped_attendee_fk": {
+ "name": "knight_hacks_hacker_check_in_attempt_scoped_attendee_fk",
+ "tableFrom": "knight_hacks_hacker_check_in_attempt",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["hacker_attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_check_in_attempt_scoped_attendance_fk": {
+ "name": "knight_hacks_hacker_check_in_attempt_scoped_attendance_fk",
+ "tableFrom": "knight_hacks_hacker_check_in_attempt",
+ "tableTo": "knight_hacks_hacker_event_attendee",
+ "columnsFrom": [
+ "attendance_id",
+ "hackathon_id",
+ "event_id",
+ "hacker_attendee_id"
+ ],
+ "columnsTo": ["id", "hackathon_id", "event_id", "hacker_att_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_check_in_attempt_scoped_class_fk": {
+ "name": "knight_hacks_hacker_check_in_attempt_scoped_class_fk",
+ "tableFrom": "knight_hacks_hacker_check_in_attempt",
+ "tableTo": "knight_hacks_hackathon_class",
+ "columnsFrom": ["class_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_check_in_attempt_scoped_event_fk": {
+ "name": "knight_hacks_hacker_check_in_attempt_scoped_event_fk",
+ "tableFrom": "knight_hacks_hacker_check_in_attempt",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_check_in_attempt_attendanceId_unique": {
+ "name": "knight_hacks_hacker_check_in_attempt_attendanceId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attendance_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_check_in_attempt_mode_check": {
+ "name": "knight_hacks_hacker_check_in_attempt_mode_check",
+ "value": "\"knight_hacks_hacker_check_in_attempt\".\"mode\" IN ('scanner', 'manual')"
+ },
+ "knight_hacks_hacker_check_in_attempt_class_color_check": {
+ "name": "knight_hacks_hacker_check_in_attempt_class_color_check",
+ "value": "\"knight_hacks_hacker_check_in_attempt\".\"class_color_snapshot\" IS NULL OR \"knight_hacks_hacker_check_in_attempt\".\"class_color_snapshot\" ~ '^#[0-9A-Fa-f]{6}$'"
+ },
+ "knight_hacks_hacker_check_in_attempt_points_check": {
+ "name": "knight_hacks_hacker_check_in_attempt_points_check",
+ "value": "\"knight_hacks_hacker_check_in_attempt\".\"points_awarded\" >= 0"
+ },
+ "knight_hacks_hacker_check_in_attempt_success_retention_check": {
+ "name": "knight_hacks_hacker_check_in_attempt_success_retention_check",
+ "value": "(\"knight_hacks_hacker_check_in_attempt\".\"outcome\" = 'checked_in' AND \"knight_hacks_hacker_check_in_attempt\".\"attendance_id\" IS NOT NULL AND \"knight_hacks_hacker_check_in_attempt\".\"expires_at\" IS NULL) OR (\"knight_hacks_hacker_check_in_attempt\".\"outcome\" <> 'checked_in' AND \"knight_hacks_hacker_check_in_attempt\".\"attendance_id\" IS NULL AND \"knight_hacks_hacker_check_in_attempt\".\"expires_at\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_check_in_pass": {
+ "name": "knight_hacks_hacker_check_in_pass",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "attendee_id": {
+ "name": "attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token_hash": {
+ "name": "token_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "issued_at": {
+ "name": "issued_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_check_in_pass_active_attendee_unique": {
+ "name": "knight_hacks_hacker_check_in_pass_active_attendee_unique",
+ "columns": [
+ {
+ "expression": "attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_hacker_check_in_pass\".\"revoked_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_check_in_pass_attendee_idx": {
+ "name": "knight_hacks_hacker_check_in_pass_attendee_idx",
+ "columns": [
+ {
+ "expression": "attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_check_in_pass_scoped_attendee_fk": {
+ "name": "knight_hacks_hacker_check_in_pass_scoped_attendee_fk",
+ "tableFrom": "knight_hacks_hacker_check_in_pass",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_check_in_pass_token_hash_unique": {
+ "name": "knight_hacks_hacker_check_in_pass_token_hash_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token_hash"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_check_in_pass_token_hash_check": {
+ "name": "knight_hacks_hacker_check_in_pass_token_hash_check",
+ "value": "\"knight_hacks_hacker_check_in_pass\".\"token_hash\" ~ '^[0-9a-f]{64}$'"
+ },
+ "knight_hacks_hacker_check_in_pass_version_check": {
+ "name": "knight_hacks_hacker_check_in_pass_version_check",
+ "value": "\"knight_hacks_hacker_check_in_pass\".\"version\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_discord_role_grant": {
+ "name": "knight_hacks_hacker_discord_role_grant",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hacker_attendee_id": {
+ "name": "hacker_attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_attendance_id": {
+ "name": "source_attendance_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_event_id": {
+ "name": "source_event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "hacker_discord_role_kind",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "desired_role_id": {
+ "name": "desired_role_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "hacker_discord_role_grant_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempt_count": {
+ "name": "attempt_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_attempt_at": {
+ "name": "last_attempt_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "succeeded_at": {
+ "name": "succeeded_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_token": {
+ "name": "lease_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_discord_role_grant_repair_queue_idx": {
+ "name": "knight_hacks_hacker_discord_role_grant_repair_queue_idx",
+ "columns": [
+ {
+ "expression": "state",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lease_expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_discord_role_grant_scoped_attendee_fk": {
+ "name": "knight_hacks_hacker_discord_role_grant_scoped_attendee_fk",
+ "tableFrom": "knight_hacks_hacker_discord_role_grant",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["hacker_attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_discord_role_grant_scoped_attendance_fk": {
+ "name": "knight_hacks_hacker_discord_role_grant_scoped_attendance_fk",
+ "tableFrom": "knight_hacks_hacker_discord_role_grant",
+ "tableTo": "knight_hacks_hacker_event_attendee",
+ "columnsFrom": [
+ "source_attendance_id",
+ "hackathon_id",
+ "source_event_id",
+ "hacker_attendee_id"
+ ],
+ "columnsTo": ["id", "hackathon_id", "event_id", "hacker_att_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_discord_role_grant_logical_unique": {
+ "name": "knight_hacks_hacker_discord_role_grant_logical_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hacker_attendee_id", "kind"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_discord_role_grant_role_id_check": {
+ "name": "knight_hacks_hacker_discord_role_grant_role_id_check",
+ "value": "\"knight_hacks_hacker_discord_role_grant\".\"desired_role_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hacker_discord_role_grant_attempt_count_check": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_count_check",
+ "value": "\"knight_hacks_hacker_discord_role_grant\".\"attempt_count\" >= 0"
+ },
+ "knight_hacks_hacker_discord_role_grant_lease_pair_check": {
+ "name": "knight_hacks_hacker_discord_role_grant_lease_pair_check",
+ "value": "(\"knight_hacks_hacker_discord_role_grant\".\"lease_token\" IS NULL) = (\"knight_hacks_hacker_discord_role_grant\".\"lease_expires_at\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_discord_role_grant_attempt": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "grant_id": {
+ "name": "grant_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempt_token": {
+ "name": "attempt_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id_snapshot": {
+ "name": "role_id_snapshot",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "discord_user_id_snapshot": {
+ "name": "discord_user_id_snapshot",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attempted_by": {
+ "name": "attempted_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "outcome": {
+ "name": "outcome",
+ "type": "hacker_discord_role_attempt_outcome",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "error": {
+ "name": "error",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_discord_role_grant_attempt_history_idx": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_history_idx",
+ "columns": [
+ {
+ "expression": "grant_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_discord_role_grant_attempt_grant_id_knight_hacks_hacker_discord_role_grant_id_fk": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_grant_id_knight_hacks_hacker_discord_role_grant_id_fk",
+ "tableFrom": "knight_hacks_hacker_discord_role_grant_attempt",
+ "tableTo": "knight_hacks_hacker_discord_role_grant",
+ "columnsFrom": ["grant_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_discord_role_grant_attempt_attempted_by_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_attempted_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_discord_role_grant_attempt",
+ "tableTo": "auth_user",
+ "columnsFrom": ["attempted_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_discord_role_grant_attempt_attemptToken_unique": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_attemptToken_unique",
+ "nullsNotDistinct": false,
+ "columns": ["attempt_token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_discord_role_grant_attempt_role_id_check": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_role_id_check",
+ "value": "\"knight_hacks_hacker_discord_role_grant_attempt\".\"role_id_snapshot\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hacker_discord_role_grant_attempt_user_id_check": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_user_id_check",
+ "value": "\"knight_hacks_hacker_discord_role_grant_attempt\".\"discord_user_id_snapshot\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_hacker_discord_role_grant_attempt_completion_check": {
+ "name": "knight_hacks_hacker_discord_role_grant_attempt_completion_check",
+ "value": "(\"knight_hacks_hacker_discord_role_grant_attempt\".\"outcome\" = 'pending' AND \"knight_hacks_hacker_discord_role_grant_attempt\".\"finished_at\" IS NULL) OR (\"knight_hacks_hacker_discord_role_grant_attempt\".\"outcome\" <> 'pending' AND \"knight_hacks_hacker_discord_role_grant_attempt\".\"finished_at\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_event_attendee": {
+ "name": "knight_hacks_hacker_event_attendee",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hacker_att_id": {
+ "name": "hacker_att_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_id": {
+ "name": "event_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checked_in_at": {
+ "name": "checked_in_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "checked_in_by": {
+ "name": "checked_in_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "points_awarded": {
+ "name": "points_awarded",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_initial_attendance": {
+ "name": "is_initial_attendance",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "voided_at": {
+ "name": "voided_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "voided_by": {
+ "name": "voided_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "void_reason": {
+ "name": "void_reason",
+ "type": "varchar(300)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_event_attendee_event_attendee_history_idx": {
+ "name": "knight_hacks_hacker_event_attendee_event_attendee_history_idx",
+ "columns": [
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "hacker_att_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "checked_in_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_event_attendee_attendee_event_history_idx": {
+ "name": "knight_hacks_hacker_event_attendee_attendee_event_history_idx",
+ "columns": [
+ {
+ "expression": "hacker_att_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "checked_in_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_event_attendee_hackathon_history_idx": {
+ "name": "knight_hacks_hacker_event_attendee_hackathon_history_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "checked_in_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_event_attendee_checked_in_by_idx": {
+ "name": "knight_hacks_hacker_event_attendee_checked_in_by_idx",
+ "columns": [
+ {
+ "expression": "checked_in_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_event_attendee_voided_by_idx": {
+ "name": "knight_hacks_hacker_event_attendee_voided_by_idx",
+ "columns": [
+ {
+ "expression": "voided_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_hacker_event_attendee_one_active_initial": {
+ "name": "knight_hacks_hacker_event_attendee_one_active_initial",
+ "columns": [
+ {
+ "expression": "event_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "hacker_att_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_hacker_event_attendee\".\"is_initial_attendance\" = true AND \"knight_hacks_hacker_event_attendee\".\"voided_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_event_attendee_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hacker_event_attendee_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hacker_event_attendee",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_event_attendee_checked_in_by_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_event_attendee_checked_in_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_event_attendee",
+ "tableTo": "auth_user",
+ "columnsFrom": ["checked_in_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_event_attendee_voided_by_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_event_attendee_voided_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_event_attendee",
+ "tableTo": "auth_user",
+ "columnsFrom": ["voided_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_event_attendee_scoped_attendee_fk": {
+ "name": "knight_hacks_hacker_event_attendee_scoped_attendee_fk",
+ "tableFrom": "knight_hacks_hacker_event_attendee",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["hacker_att_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_event_attendee_scoped_event_fk": {
+ "name": "knight_hacks_hacker_event_attendee_scoped_event_fk",
+ "tableFrom": "knight_hacks_hacker_event_attendee",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_event_attendee_attempt_scope_unique": {
+ "name": "knight_hacks_hacker_event_attendee_attempt_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id", "event_id", "hacker_att_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_event_attendee_points_awarded_check": {
+ "name": "knight_hacks_hacker_event_attendee_points_awarded_check",
+ "value": "\"knight_hacks_hacker_event_attendee\".\"points_awarded\" IS NULL OR \"knight_hacks_hacker_event_attendee\".\"points_awarded\" >= 0"
+ },
+ "knight_hacks_hacker_event_attendee_void_metadata_check": {
+ "name": "knight_hacks_hacker_event_attendee_void_metadata_check",
+ "value": "(\"knight_hacks_hacker_event_attendee\".\"voided_at\" IS NULL AND \"knight_hacks_hacker_event_attendee\".\"void_reason\" IS NULL) OR (\"knight_hacks_hacker_event_attendee\".\"voided_at\" IS NOT NULL AND \"knight_hacks_hacker_event_attendee\".\"void_reason\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_participant_command": {
+ "name": "knight_hacks_hacker_participant_command",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "operation": {
+ "name": "operation",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "idempotency_key": {
+ "name": "idempotency_key",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload_hash": {
+ "name": "payload_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "hacker_participant_command_state",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'started'"
+ },
+ "result": {
+ "name": "result",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "safe_error_code": {
+ "name": "safe_error_code",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_participant_command_expiry_idx": {
+ "name": "knight_hacks_hacker_participant_command_expiry_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_participant_command_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_participant_command_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_participant_command",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_participant_command_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hacker_participant_command_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hacker_participant_command",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_participant_command_identity_unique": {
+ "name": "knight_hacks_hacker_participant_command_identity_unique",
+ "nullsNotDistinct": false,
+ "columns": ["user_id", "hackathon_id", "operation", "idempotency_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_participant_command_payload_hash_check": {
+ "name": "knight_hacks_hacker_participant_command_payload_hash_check",
+ "value": "\"knight_hacks_hacker_participant_command\".\"payload_hash\" ~ '^[0-9a-f]{64}$'"
+ },
+ "knight_hacks_hacker_participant_command_completion_check": {
+ "name": "knight_hacks_hacker_participant_command_completion_check",
+ "value": "(\"knight_hacks_hacker_participant_command\".\"state\" = 'started' AND \"knight_hacks_hacker_participant_command\".\"completed_at\" IS NULL) OR (\"knight_hacks_hacker_participant_command\".\"state\" <> 'started' AND \"knight_hacks_hacker_participant_command\".\"completed_at\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_profile": {
+ "name": "knight_hacks_hacker_profile",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "first_name": {
+ "name": "first_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_name": {
+ "name": "last_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "gender": {
+ "name": "gender",
+ "type": "gender",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "discord_user": {
+ "name": "discord_user",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "country": {
+ "name": "country",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "phone_number": {
+ "name": "phone_number",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "school": {
+ "name": "school",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "level_of_study": {
+ "name": "level_of_study",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "major": {
+ "name": "major",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "race_or_ethnicity": {
+ "name": "race_or_ethnicity",
+ "type": "race_or_ethnicity",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shirt_size": {
+ "name": "shirt_size",
+ "type": "shirt_size",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_profile_url": {
+ "name": "github_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "linkedin_profile_url": {
+ "name": "linkedin_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website_url": {
+ "name": "website_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resume_url": {
+ "name": "resume_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dob": {
+ "name": "dob",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grad_date": {
+ "name": "grad_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "food_allergies": {
+ "name": "food_allergies",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_hacker_profile_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_profile_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_profile",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_profile_user_unique": {
+ "name": "knight_hacks_hacker_profile_user_unique",
+ "nullsNotDistinct": false,
+ "columns": ["user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_profile_revision_check": {
+ "name": "knight_hacks_hacker_profile_revision_check",
+ "value": "\"knight_hacks_hacker_profile\".\"revision\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_profile_revision": {
+ "name": "knight_hacks_hacker_profile_revision",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "profile_id": {
+ "name": "profile_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "legacy_hacker_id": {
+ "name": "legacy_hacker_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "first_name": {
+ "name": "first_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_name": {
+ "name": "last_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "gender": {
+ "name": "gender",
+ "type": "gender",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "discord_user": {
+ "name": "discord_user",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "country": {
+ "name": "country",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "phone_number": {
+ "name": "phone_number",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "school": {
+ "name": "school",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "level_of_study": {
+ "name": "level_of_study",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "major": {
+ "name": "major",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "race_or_ethnicity": {
+ "name": "race_or_ethnicity",
+ "type": "race_or_ethnicity",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shirt_size": {
+ "name": "shirt_size",
+ "type": "shirt_size",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_profile_url": {
+ "name": "github_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "linkedin_profile_url": {
+ "name": "linkedin_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website_url": {
+ "name": "website_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resume_url": {
+ "name": "resume_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dob": {
+ "name": "dob",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grad_date": {
+ "name": "grad_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "food_allergies": {
+ "name": "food_allergies",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_hacker_profile_revision_profile_created_idx": {
+ "name": "knight_hacks_hacker_profile_revision_profile_created_idx",
+ "columns": [
+ {
+ "expression": "profile_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_profile_revision_profile_id_knight_hacks_hacker_profile_id_fk": {
+ "name": "knight_hacks_hacker_profile_revision_profile_id_knight_hacks_hacker_profile_id_fk",
+ "tableFrom": "knight_hacks_hacker_profile_revision",
+ "tableTo": "knight_hacks_hacker_profile",
+ "columnsFrom": ["profile_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_profile_revision_legacy_hacker_id_knight_hacks_hacker_id_fk": {
+ "name": "knight_hacks_hacker_profile_revision_legacy_hacker_id_knight_hacks_hacker_id_fk",
+ "tableFrom": "knight_hacks_hacker_profile_revision",
+ "tableTo": "knight_hacks_hacker",
+ "columnsFrom": ["legacy_hacker_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_hacker_profile_revision_created_by_auth_user_id_fk": {
+ "name": "knight_hacks_hacker_profile_revision_created_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_hacker_profile_revision",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_hacker_profile_revision_legacyHackerId_unique": {
+ "name": "knight_hacks_hacker_profile_revision_legacyHackerId_unique",
+ "nullsNotDistinct": false,
+ "columns": ["legacy_hacker_id"]
+ },
+ "knight_hacks_hacker_profile_revision_profile_version_unique": {
+ "name": "knight_hacks_hacker_profile_revision_profile_version_unique",
+ "nullsNotDistinct": false,
+ "columns": ["profile_id", "revision"]
+ },
+ "knight_hacks_hacker_profile_revision_id_profile_unique": {
+ "name": "knight_hacks_hacker_profile_revision_id_profile_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "profile_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_hacker_profile_revision_version_check": {
+ "name": "knight_hacks_hacker_profile_revision_version_check",
+ "value": "\"knight_hacks_hacker_profile_revision\".\"revision\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_team": {
+ "name": "knight_hacks_hacker_team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "together": {
+ "name": "together",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "frozen_at": {
+ "name": "frozen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "class_id": {
+ "name": "class_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "hacker_team_hackathon_idx": {
+ "name": "hacker_team_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "hacker_team_class_idx": {
+ "name": "hacker_team_class_idx",
+ "columns": [
+ {
+ "expression": "class_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_hacker_team_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_hacker_team_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_hacker_team",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "hacker_team_scoped_class_fk": {
+ "name": "hacker_team_scoped_class_fk",
+ "tableFrom": "knight_hacks_hacker_team",
+ "tableTo": "knight_hacks_hackathon_class",
+ "columnsFrom": ["class_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "hacker_team_id_hackathon_unique": {
+ "name": "hacker_team_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "hacker_team_name_required": {
+ "name": "hacker_team_name_required",
+ "value": "length(trim(\"knight_hacks_hacker_team\".\"name\")) > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_hacker_team_member": {
+ "name": "knight_hacks_hacker_team_member",
+ "schema": "",
+ "columns": {
+ "attendee_id": {
+ "name": "attendee_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "hacker_team_member_team_idx": {
+ "name": "hacker_team_member_team_idx",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "hacker_team_member_hackathon_idx": {
+ "name": "hacker_team_member_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "hacker_team_one_owner": {
+ "name": "hacker_team_one_owner",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_hacker_team_member\".\"role\" = 'owner'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "hacker_team_member_scoped_team_fk": {
+ "name": "hacker_team_member_scoped_team_fk",
+ "tableFrom": "knight_hacks_hacker_team_member",
+ "tableTo": "knight_hacks_hacker_team",
+ "columnsFrom": ["team_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "hacker_team_member_scoped_attendee_fk": {
+ "name": "hacker_team_member_scoped_attendee_fk",
+ "tableFrom": "knight_hacks_hacker_team_member",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "hacker_team_member_role_valid": {
+ "name": "hacker_team_member_role_valid",
+ "value": "\"knight_hacks_hacker_team_member\".\"role\" in ('pending', 'member', 'owner')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issue": {
+ "name": "knight_hacks_issue",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "status": {
+ "name": "status",
+ "type": "issue_status",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "links": {
+ "name": "links",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "event": {
+ "name": "event",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discord_thread_id": {
+ "name": "discord_thread_id",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "date": {
+ "name": "date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_at": {
+ "name": "due_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "priority": {
+ "name": "priority",
+ "type": "issue_priority",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "team": {
+ "name": "team",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "creator": {
+ "name": "creator",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent": {
+ "name": "parent",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archived_by": {
+ "name": "archived_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archive_batch_id": {
+ "name": "archive_batch_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creation_key": {
+ "name": "creation_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creation_hash": {
+ "name": "creation_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "issue_team_idx": {
+ "name": "issue_team_idx",
+ "columns": [
+ {
+ "expression": "team",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_creator_idx": {
+ "name": "issue_creator_idx",
+ "columns": [
+ {
+ "expression": "creator",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_status_idx": {
+ "name": "issue_status_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_date_idx": {
+ "name": "issue_date_idx",
+ "columns": [
+ {
+ "expression": "date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_due_at_idx": {
+ "name": "issue_due_at_idx",
+ "columns": [
+ {
+ "expression": "due_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_archive_idx": {
+ "name": "issue_archive_idx",
+ "columns": [
+ {
+ "expression": "archived_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "archive_batch_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_parent_idx": {
+ "name": "issue_parent_idx",
+ "columns": [
+ {
+ "expression": "parent",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "issue_priority_idx": {
+ "name": "issue_priority_idx",
+ "columns": [
+ {
+ "expression": "priority",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_issue_event_knight_hacks_event_id_fk": {
+ "name": "knight_hacks_issue_event_knight_hacks_event_id_fk",
+ "tableFrom": "knight_hacks_issue",
+ "tableTo": "knight_hacks_event",
+ "columnsFrom": ["event"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_team_auth_roles_id_fk": {
+ "name": "knight_hacks_issue_team_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_issue",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["team"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_creator_auth_user_id_fk": {
+ "name": "knight_hacks_issue_creator_auth_user_id_fk",
+ "tableFrom": "knight_hacks_issue",
+ "tableTo": "auth_user",
+ "columnsFrom": ["creator"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_archived_by_auth_user_id_fk": {
+ "name": "knight_hacks_issue_archived_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_issue",
+ "tableTo": "auth_user",
+ "columnsFrom": ["archived_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "issue_parent_fk": {
+ "name": "issue_parent_fk",
+ "tableFrom": "knight_hacks_issue",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["parent"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_issue_creation_key_unique": {
+ "name": "knight_hacks_issue_creation_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["creation_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issue_attachment": {
+ "name": "knight_hacks_issue_attachment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "issue_id": {
+ "name": "issue_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "draft_key": {
+ "name": "draft_key",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "owner_user_id": {
+ "name": "owner_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "object_name": {
+ "name": "object_name",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "finalized_at": {
+ "name": "finalized_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_issue_attachment_issue_idx": {
+ "name": "knight_hacks_issue_attachment_issue_idx",
+ "columns": [
+ {
+ "expression": "issue_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_issue_attachment_draft_idx": {
+ "name": "knight_hacks_issue_attachment_draft_idx",
+ "columns": [
+ {
+ "expression": "draft_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_issue_attachment_issue_id_knight_hacks_issue_id_fk": {
+ "name": "knight_hacks_issue_attachment_issue_id_knight_hacks_issue_id_fk",
+ "tableFrom": "knight_hacks_issue_attachment",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["issue_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_attachment_team_id_auth_roles_id_fk": {
+ "name": "knight_hacks_issue_attachment_team_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_issue_attachment",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["team_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_attachment_owner_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_issue_attachment_owner_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_issue_attachment",
+ "tableTo": "auth_user",
+ "columnsFrom": ["owner_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_issue_attachment_objectName_unique": {
+ "name": "knight_hacks_issue_attachment_objectName_unique",
+ "nullsNotDistinct": false,
+ "columns": ["object_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_issue_attachment_owner_check": {
+ "name": "knight_hacks_issue_attachment_owner_check",
+ "value": "NOT (\"knight_hacks_issue_attachment\".\"issue_id\" IS NOT NULL AND \"knight_hacks_issue_attachment\".\"draft_key\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issue_attachment_reference": {
+ "name": "knight_hacks_issue_attachment_reference",
+ "schema": "",
+ "columns": {
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "issue_id": {
+ "name": "issue_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "issue_attachment_reference_issue_idx": {
+ "name": "issue_attachment_reference_issue_idx",
+ "columns": [
+ {
+ "expression": "issue_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_issue_attachment_reference_attachment_id_knight_hacks_issue_attachment_id_fk": {
+ "name": "knight_hacks_issue_attachment_reference_attachment_id_knight_hacks_issue_attachment_id_fk",
+ "tableFrom": "knight_hacks_issue_attachment_reference",
+ "tableTo": "knight_hacks_issue_attachment",
+ "columnsFrom": ["attachment_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_attachment_reference_issue_id_knight_hacks_issue_id_fk": {
+ "name": "knight_hacks_issue_attachment_reference_issue_id_knight_hacks_issue_id_fk",
+ "tableFrom": "knight_hacks_issue_attachment_reference",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["issue_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_issue_attachment_reference_attachment_id_issue_id_pk": {
+ "name": "knight_hacks_issue_attachment_reference_attachment_id_issue_id_pk",
+ "columns": ["attachment_id", "issue_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issue_history": {
+ "name": "knight_hacks_issue_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "issue_id": {
+ "name": "issue_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_display_name": {
+ "name": "actor_display_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "changed_fields": {
+ "name": "changed_fields",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "before": {
+ "name": "before",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "after": {
+ "name": "after",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "issue_history_issue_created_idx": {
+ "name": "issue_history_issue_created_idx",
+ "columns": [
+ {
+ "expression": "issue_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_issue_history_issue_id_knight_hacks_issue_id_fk": {
+ "name": "knight_hacks_issue_history_issue_id_knight_hacks_issue_id_fk",
+ "tableFrom": "knight_hacks_issue_history",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["issue_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issue_history_actor_id_auth_user_id_fk": {
+ "name": "knight_hacks_issue_history_actor_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_issue_history",
+ "tableTo": "auth_user",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issue_reminder_delivery": {
+ "name": "knight_hacks_issue_reminder_delivery",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "issue_id": {
+ "name": "issue_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "due_at": {
+ "name": "due_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reminder_key": {
+ "name": "reminder_key",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "destination_snapshot": {
+ "name": "destination_snapshot",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_snapshot": {
+ "name": "content_snapshot",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "attempt_count": {
+ "name": "attempt_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "locked_at": {
+ "name": "locked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivered_at": {
+ "name": "delivered_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_attempt_at": {
+ "name": "next_attempt_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "issue_reminder_delivery_pending_idx": {
+ "name": "issue_reminder_delivery_pending_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "next_attempt_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_issue_reminder_delivery_issue_id_knight_hacks_issue_id_fk": {
+ "name": "knight_hacks_issue_reminder_delivery_issue_id_knight_hacks_issue_id_fk",
+ "tableFrom": "knight_hacks_issue_reminder_delivery",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["issue_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "issue_reminder_delivery_identity_unique": {
+ "name": "issue_reminder_delivery_identity_unique",
+ "nullsNotDistinct": false,
+ "columns": ["issue_id", "due_at", "reminder_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issues_to_teams_visibility": {
+ "name": "knight_hacks_issues_to_teams_visibility",
+ "schema": "",
+ "columns": {
+ "issue_id": {
+ "name": "issue_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_issues_to_teams_visibility_issue_id_knight_hacks_issue_id_fk": {
+ "name": "knight_hacks_issues_to_teams_visibility_issue_id_knight_hacks_issue_id_fk",
+ "tableFrom": "knight_hacks_issues_to_teams_visibility",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["issue_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issues_to_teams_visibility_team_id_auth_roles_id_fk": {
+ "name": "knight_hacks_issues_to_teams_visibility_team_id_auth_roles_id_fk",
+ "tableFrom": "knight_hacks_issues_to_teams_visibility",
+ "tableTo": "auth_roles",
+ "columnsFrom": ["team_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_issues_to_teams_visibility_issue_id_team_id_pk": {
+ "name": "knight_hacks_issues_to_teams_visibility_issue_id_team_id_pk",
+ "columns": ["issue_id", "team_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_issues_to_users_assignment": {
+ "name": "knight_hacks_issues_to_users_assignment",
+ "schema": "",
+ "columns": {
+ "issue_id": {
+ "name": "issue_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_issues_to_users_assignment_issue_id_knight_hacks_issue_id_fk": {
+ "name": "knight_hacks_issues_to_users_assignment_issue_id_knight_hacks_issue_id_fk",
+ "tableFrom": "knight_hacks_issues_to_users_assignment",
+ "tableTo": "knight_hacks_issue",
+ "columnsFrom": ["issue_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_issues_to_users_assignment_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_issues_to_users_assignment_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_issues_to_users_assignment",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_issues_to_users_assignment_issue_id_user_id_pk": {
+ "name": "knight_hacks_issues_to_users_assignment_issue_id_user_id_pk",
+ "columns": ["issue_id", "user_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judge": {
+ "name": "knight_hacks_judge",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "judge_kind",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_name": {
+ "name": "display_name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_judge_member_unique": {
+ "name": "knight_hacks_judge_member_unique",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judge\".\"user_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judge_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_judge_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_judge",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judge_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judge_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judge",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judge_id_hackathon_unique": {
+ "name": "knight_hacks_judge_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judge_kind_identity_check": {
+ "name": "knight_hacks_judge_kind_identity_check",
+ "value": "\"knight_hacks_judge\".\"kind\" = 'member' OR (\"knight_hacks_judge\".\"kind\" = 'guest' AND \"knight_hacks_judge\".\"user_id\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judge_deliberation_entry": {
+ "name": "knight_hacks_judge_deliberation_entry",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "section_id": {
+ "name": "section_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_judge_deliberation_entry_section_scope_fk": {
+ "name": "knight_hacks_judge_deliberation_entry_section_scope_fk",
+ "tableFrom": "knight_hacks_judge_deliberation_entry",
+ "tableTo": "knight_hacks_judge_deliberation_section",
+ "columnsFrom": ["section_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judge_deliberation_entry_project_scope_fk": {
+ "name": "knight_hacks_judge_deliberation_entry_project_scope_fk",
+ "tableFrom": "knight_hacks_judge_deliberation_entry",
+ "tableTo": "knight_hacks_project",
+ "columnsFrom": ["project_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judge_deliberation_entry_section_project_unique": {
+ "name": "knight_hacks_judge_deliberation_entry_section_project_unique",
+ "nullsNotDistinct": false,
+ "columns": ["section_id", "project_id"]
+ },
+ "knight_hacks_judge_deliberation_entry_section_order_unique": {
+ "name": "knight_hacks_judge_deliberation_entry_section_order_unique",
+ "nullsNotDistinct": false,
+ "columns": ["section_id", "display_order"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judge_deliberation_entry_order_check": {
+ "name": "knight_hacks_judge_deliberation_entry_order_check",
+ "value": "\"knight_hacks_judge_deliberation_entry\".\"display_order\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judge_deliberation_section": {
+ "name": "knight_hacks_judge_deliberation_section",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "judge_id": {
+ "name": "judge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_judge_deliberation_section_judge_scope_fk": {
+ "name": "knight_hacks_judge_deliberation_section_judge_scope_fk",
+ "tableFrom": "knight_hacks_judge_deliberation_section",
+ "tableTo": "knight_hacks_judge",
+ "columnsFrom": ["judge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judge_deliberation_section_judge_order_unique": {
+ "name": "knight_hacks_judge_deliberation_section_judge_order_unique",
+ "nullsNotDistinct": false,
+ "columns": ["judge_id", "display_order"]
+ },
+ "knight_hacks_judge_deliberation_section_id_hackathon_unique": {
+ "name": "knight_hacks_judge_deliberation_section_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judge_deliberation_section_order_check": {
+ "name": "knight_hacks_judge_deliberation_section_order_check",
+ "value": "\"knight_hacks_judge_deliberation_section\".\"display_order\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_announcement": {
+ "name": "knight_hacks_judging_announcement",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "message": {
+ "name": "message",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "include_guests": {
+ "name": "include_guests",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_urgent": {
+ "name": "is_urgent",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "published_by_user_id": {
+ "name": "published_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "published_at": {
+ "name": "published_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "cleared_at": {
+ "name": "cleared_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cleared_by_user_id": {
+ "name": "cleared_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_announcement_current_global_unique": {
+ "name": "knight_hacks_judging_announcement_current_global_unique",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judging_announcement\".\"room_id\" IS NULL AND \"knight_hacks_judging_announcement\".\"cleared_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_judging_announcement_current_room_unique": {
+ "name": "knight_hacks_judging_announcement_current_room_unique",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judging_announcement\".\"room_id\" IS NOT NULL AND \"knight_hacks_judging_announcement\".\"cleared_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_judging_announcement_current_lookup_idx": {
+ "name": "knight_hacks_judging_announcement_current_lookup_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "cleared_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judging_announcement_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_judging_announcement_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_judging_announcement",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_announcement_published_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_announcement_published_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_announcement",
+ "tableTo": "auth_user",
+ "columnsFrom": ["published_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_announcement_cleared_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_announcement_cleared_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_announcement",
+ "tableTo": "auth_user",
+ "columnsFrom": ["cleared_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_announcement_room_scope_fk": {
+ "name": "knight_hacks_judging_announcement_room_scope_fk",
+ "tableFrom": "knight_hacks_judging_announcement",
+ "tableTo": "knight_hacks_judging_room",
+ "columnsFrom": ["room_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judging_announcement_message_not_blank_check": {
+ "name": "knight_hacks_judging_announcement_message_not_blank_check",
+ "value": "\"knight_hacks_judging_announcement\".\"message\" ~ '[^[:space:]]'"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_appointment": {
+ "name": "knight_hacks_judging_appointment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "schedule_id": {
+ "name": "schedule_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "challenge_id": {
+ "name": "challenge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "starts_at": {
+ "name": "starts_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deadline_at": {
+ "name": "deadline_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ends_at": {
+ "name": "ends_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_appointment_project_idx": {
+ "name": "knight_hacks_judging_appointment_project_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "starts_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judging_appointment_schedule_fk": {
+ "name": "knight_hacks_judging_appointment_schedule_fk",
+ "tableFrom": "knight_hacks_judging_appointment",
+ "tableTo": "knight_hacks_judging_schedule",
+ "columnsFrom": ["schedule_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_appointment_room_fk": {
+ "name": "knight_hacks_judging_appointment_room_fk",
+ "tableFrom": "knight_hacks_judging_appointment",
+ "tableTo": "knight_hacks_judging_room",
+ "columnsFrom": ["room_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_appointment_project_challenge_fk": {
+ "name": "knight_hacks_judging_appointment_project_challenge_fk",
+ "tableFrom": "knight_hacks_judging_appointment",
+ "tableTo": "knight_hacks_project_to_challenge",
+ "columnsFrom": ["project_id", "challenge_id", "hackathon_id"],
+ "columnsTo": ["project_id", "challenge_id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judging_appointment_task_unique": {
+ "name": "knight_hacks_judging_appointment_task_unique",
+ "nullsNotDistinct": false,
+ "columns": ["schedule_id", "project_id", "challenge_id"]
+ },
+ "knight_hacks_judging_appointment_room_slot_unique": {
+ "name": "knight_hacks_judging_appointment_room_slot_unique",
+ "nullsNotDistinct": false,
+ "columns": ["schedule_id", "room_id", "starts_at"]
+ },
+ "knight_hacks_judging_appointment_scope_unique": {
+ "name": "knight_hacks_judging_appointment_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judging_appointment_times_check": {
+ "name": "knight_hacks_judging_appointment_times_check",
+ "value": "\"knight_hacks_judging_appointment\".\"starts_at\" < \"knight_hacks_judging_appointment\".\"deadline_at\" AND \"knight_hacks_judging_appointment\".\"deadline_at\" <= \"knight_hacks_judging_appointment\".\"ends_at\""
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_building": {
+ "name": "knight_hacks_judging_building",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_building_name_unique": {
+ "name": "knight_hacks_judging_building_name_unique",
+ "columns": [
+ {
+ "expression": "lower(btrim(\"name\"))",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judging_building_name_check": {
+ "name": "knight_hacks_judging_building_name_check",
+ "value": "length(btrim(\"knight_hacks_judging_building\".\"name\")) > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_room": {
+ "name": "knight_hacks_judging_room",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "challenge_id": {
+ "name": "challenge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "building_id": {
+ "name": "building_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "discord_thread_id": {
+ "name": "discord_thread_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archived_by_user_id": {
+ "name": "archived_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_room_active_name_unique": {
+ "name": "knight_hacks_judging_room_active_name_unique",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judging_room\".\"archived_at\" IS NULL AND \"knight_hacks_judging_room\".\"building_id\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_judging_room_active_location_unique": {
+ "name": "knight_hacks_judging_room_active_location_unique",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "building_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "lower(btrim(\"name\"))",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judging_room\".\"archived_at\" IS NULL AND \"knight_hacks_judging_room\".\"building_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_judging_room_hackathon_idx": {
+ "name": "knight_hacks_judging_room_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "display_order",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judging_room_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_judging_room_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_judging_room",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_room_building_id_knight_hacks_judging_building_id_fk": {
+ "name": "knight_hacks_judging_room_building_id_knight_hacks_judging_building_id_fk",
+ "tableFrom": "knight_hacks_judging_room",
+ "tableTo": "knight_hacks_judging_building",
+ "columnsFrom": ["building_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_room_archived_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_room_archived_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_room",
+ "tableTo": "auth_user",
+ "columnsFrom": ["archived_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_room_challenge_scope_fk": {
+ "name": "knight_hacks_judging_room_challenge_scope_fk",
+ "tableFrom": "knight_hacks_judging_room",
+ "tableTo": "knight_hacks_project_challenge",
+ "columnsFrom": ["challenge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judging_room_id_hackathon_unique": {
+ "name": "knight_hacks_judging_room_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_room_access_link": {
+ "name": "knight_hacks_judging_room_access_link",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revoked_by_user_id": {
+ "name": "revoked_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revocation_reason": {
+ "name": "revocation_reason",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_room_access_link_active_room_unique": {
+ "name": "knight_hacks_judging_room_access_link_active_room_unique",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judging_room_access_link\".\"revoked_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judging_room_access_link_created_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_room_access_link_created_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_room_access_link",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_room_access_link_revoked_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_room_access_link_revoked_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_room_access_link",
+ "tableTo": "auth_user",
+ "columnsFrom": ["revoked_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_room_access_link_room_scope_fk": {
+ "name": "knight_hacks_judging_room_access_link_room_scope_fk",
+ "tableFrom": "knight_hacks_judging_room_access_link",
+ "tableTo": "knight_hacks_judging_room",
+ "columnsFrom": ["room_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judging_room_access_link_id_hackathon_unique": {
+ "name": "knight_hacks_judging_room_access_link_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_room_presence": {
+ "name": "knight_hacks_judging_room_presence",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "room_id": {
+ "name": "room_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "judge_id": {
+ "name": "judge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "left_at": {
+ "name": "left_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "leave_reason": {
+ "name": "leave_reason",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_room_presence_active_judge_unique": {
+ "name": "knight_hacks_judging_room_presence_active_judge_unique",
+ "columns": [
+ {
+ "expression": "judge_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"knight_hacks_judging_room_presence\".\"left_at\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_judging_room_presence_room_idx": {
+ "name": "knight_hacks_judging_room_presence_room_idx",
+ "columns": [
+ {
+ "expression": "room_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "left_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judging_room_presence_room_scope_fk": {
+ "name": "knight_hacks_judging_room_presence_room_scope_fk",
+ "tableFrom": "knight_hacks_judging_room_presence",
+ "tableTo": "knight_hacks_judging_room",
+ "columnsFrom": ["room_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_room_presence_judge_scope_fk": {
+ "name": "knight_hacks_judging_room_presence_judge_scope_fk",
+ "tableFrom": "knight_hacks_judging_room_presence",
+ "tableTo": "knight_hacks_judge",
+ "columnsFrom": ["judge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_rubric_item": {
+ "name": "knight_hacks_judging_rubric_item",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "judging_rubric_item_kind",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "required": {
+ "name": "required",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "member_visibility_policy": {
+ "name": "member_visibility_policy",
+ "type": "judging_response_visibility",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guest_visibility_policy": {
+ "name": "guest_visibility_policy",
+ "type": "judging_response_visibility",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_judging_rubric_item_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_judging_rubric_item_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_judging_rubric_item",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judging_rubric_item_hackathon_order_unique": {
+ "name": "knight_hacks_judging_rubric_item_hackathon_order_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id", "display_order"]
+ },
+ "knight_hacks_judging_rubric_item_id_hackathon_unique": {
+ "name": "knight_hacks_judging_rubric_item_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judging_rubric_item_display_order_check": {
+ "name": "knight_hacks_judging_rubric_item_display_order_check",
+ "value": "\"knight_hacks_judging_rubric_item\".\"display_order\" >= 0"
+ },
+ "knight_hacks_judging_rubric_item_visibility_check": {
+ "name": "knight_hacks_judging_rubric_item_visibility_check",
+ "value": "(\"knight_hacks_judging_rubric_item\".\"kind\" = 'rating' AND \"knight_hacks_judging_rubric_item\".\"required\" = true AND \"knight_hacks_judging_rubric_item\".\"member_visibility_policy\" IS NULL AND \"knight_hacks_judging_rubric_item\".\"guest_visibility_policy\" IS NULL) OR (\"knight_hacks_judging_rubric_item\".\"kind\" = 'short_response' AND \"knight_hacks_judging_rubric_item\".\"member_visibility_policy\" IS NOT NULL AND \"knight_hacks_judging_rubric_item\".\"guest_visibility_policy\" IS NOT NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_schedule": {
+ "name": "knight_hacks_judging_schedule",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "starts_at": {
+ "name": "starts_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ends_at": {
+ "name": "ends_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "setup_minutes": {
+ "name": "setup_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "judging_minutes": {
+ "name": "judging_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "teardown_minutes": {
+ "name": "teardown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "same_building_break_minutes": {
+ "name": "same_building_break_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "different_building_break_minutes": {
+ "name": "different_building_break_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reduced_breaks_acknowledged_at": {
+ "name": "reduced_breaks_acknowledged_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "first_result_at": {
+ "name": "first_result_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "saved_by_user_id": {
+ "name": "saved_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_judging_schedule_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_judging_schedule_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_judging_schedule",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_schedule_saved_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_schedule_saved_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_schedule",
+ "tableTo": "auth_user",
+ "columnsFrom": ["saved_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_judging_schedule_hackathon_unique": {
+ "name": "knight_hacks_judging_schedule_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id"]
+ },
+ "knight_hacks_judging_schedule_scope_unique": {
+ "name": "knight_hacks_judging_schedule_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_judging_schedule_timing_check": {
+ "name": "knight_hacks_judging_schedule_timing_check",
+ "value": "\"knight_hacks_judging_schedule\".\"ends_at\" > \"knight_hacks_judging_schedule\".\"starts_at\" AND \"knight_hacks_judging_schedule\".\"setup_minutes\" >= 0 AND \"knight_hacks_judging_schedule\".\"judging_minutes\" > 0 AND \"knight_hacks_judging_schedule\".\"teardown_minutes\" >= 0 AND \"knight_hacks_judging_schedule\".\"same_building_break_minutes\" > 0 AND \"knight_hacks_judging_schedule\".\"different_building_break_minutes\" >= \"knight_hacks_judging_schedule\".\"same_building_break_minutes\""
+ },
+ "knight_hacks_judging_schedule_minute_check": {
+ "name": "knight_hacks_judging_schedule_minute_check",
+ "value": "extract(second from \"knight_hacks_judging_schedule\".\"starts_at\") = 0 AND extract(second from \"knight_hacks_judging_schedule\".\"ends_at\") = 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_judging_schedule_job": {
+ "name": "knight_hacks_judging_schedule_job",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source_fingerprint": {
+ "name": "source_fingerprint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "timing": {
+ "name": "timing",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "problem": {
+ "name": "problem",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "checkpoint": {
+ "name": "checkpoint",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'searching'"
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "lease_token": {
+ "name": "lease_token",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_judging_schedule_job_hackathon_idx": {
+ "name": "knight_hacks_judging_schedule_job_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_judging_schedule_job_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_judging_schedule_job_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_judging_schedule_job",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_judging_schedule_job_created_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_judging_schedule_job_created_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_judging_schedule_job",
+ "tableTo": "auth_user",
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_member": {
+ "name": "knight_hacks_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "first_name": {
+ "name": "first_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_name": {
+ "name": "last_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "discord_user": {
+ "name": "discord_user",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "age": {
+ "name": "age",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "phone_number": {
+ "name": "phone_number",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "school": {
+ "name": "school",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "level_of_study": {
+ "name": "level_of_study",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "major": {
+ "name": "major",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Computer Science'"
+ },
+ "gender": {
+ "name": "gender",
+ "type": "gender",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Prefer not to answer'"
+ },
+ "race_or_ethnicity": {
+ "name": "race_or_ethnicity",
+ "type": "race_or_ethnicity",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Prefer not to answer'"
+ },
+ "guild_profile_visible": {
+ "name": "guild_profile_visible",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "guild_resume_visible": {
+ "name": "guild_resume_visible",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "guild_opportunity_statuses": {
+ "name": "guild_opportunity_statuses",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "tagline": {
+ "name": "tagline",
+ "type": "varchar(80)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "about": {
+ "name": "about",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "profile_picture_url": {
+ "name": "profile_picture_url",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shirt_size": {
+ "name": "shirt_size",
+ "type": "shirt_size",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "github_profile_url": {
+ "name": "github_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "linkedin_profile_url": {
+ "name": "linkedin_profile_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website_url": {
+ "name": "website_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resume_url": {
+ "name": "resume_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dob": {
+ "name": "dob",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grad_date": {
+ "name": "grad_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alumni_confirmed_at": {
+ "name": "alumni_confirmed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "company": {
+ "name": "company",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_city_key": {
+ "name": "current_city_key",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "guild_location_visible": {
+ "name": "guild_location_visible",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "points": {
+ "name": "points",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "date_created": {
+ "name": "date_created",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "time_created": {
+ "name": "time_created",
+ "type": "time",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_member_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_member_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_member",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_member_email_unique": {
+ "name": "knight_hacks_member_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ },
+ "knight_hacks_member_phoneNumber_unique": {
+ "name": "knight_hacks_member_phoneNumber_unique",
+ "nullsNotDistinct": false,
+ "columns": ["phone_number"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_member_valid_guild_opportunity_statuses": {
+ "name": "knight_hacks_member_valid_guild_opportunity_statuses",
+ "value": "\"knight_hacks_member\".\"guild_opportunity_statuses\" <@ ARRAY['internships', 'full-time', 'freelance-contract', 'project-collaboration', 'offering-mentorship', 'seeking-mentorship']::text[] AND cardinality(\"knight_hacks_member\".\"guild_opportunity_statuses\") <= 3"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_companies": {
+ "name": "knight_hacks_companies",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_point_store_item": {
+ "name": "knight_hacks_point_store_item",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(2000)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "price": {
+ "name": "price",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stock": {
+ "name": "stock",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sold_out": {
+ "name": "sold_out",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "image_object_name": {
+ "name": "image_object_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ }
+ },
+ "indexes": {
+ "point_store_item_hackathon_idx": {
+ "name": "point_store_item_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_point_store_item_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_point_store_item_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_point_store_item",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "point_store_item_hackathon_unique": {
+ "name": "point_store_item_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "point_store_item_price_check": {
+ "name": "point_store_item_price_check",
+ "value": "\"knight_hacks_point_store_item\".\"price\" BETWEEN 0 AND 1000000"
+ },
+ "point_store_item_stock_check": {
+ "name": "point_store_item_stock_check",
+ "value": "\"knight_hacks_point_store_item\".\"stock\" IS NULL OR \"knight_hacks_point_store_item\".\"stock\" BETWEEN 0 AND 1000000"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_point_store_purchase": {
+ "name": "knight_hacks_point_store_purchase",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attendee_id": {
+ "name": "attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_id": {
+ "name": "item_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hacker_name": {
+ "name": "hacker_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "unit_price": {
+ "name": "unit_price",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "quantity": {
+ "name": "quantity",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "total": {
+ "name": "total",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stock_tracked": {
+ "name": "stock_tracked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actor_name": {
+ "name": "actor_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "voided_at": {
+ "name": "voided_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "voided_by": {
+ "name": "voided_by",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "voided_by_name": {
+ "name": "voided_by_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "void_reason": {
+ "name": "void_reason",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "restocked": {
+ "name": "restocked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {
+ "point_store_purchase_history_idx": {
+ "name": "point_store_purchase_history_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "point_store_purchase_balance_idx": {
+ "name": "point_store_purchase_balance_idx",
+ "columns": [
+ {
+ "expression": "attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_point_store_purchase_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_point_store_purchase_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_point_store_purchase",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_point_store_purchase_attendee_id_knight_hacks_hacker_attendee_id_fk": {
+ "name": "knight_hacks_point_store_purchase_attendee_id_knight_hacks_hacker_attendee_id_fk",
+ "tableFrom": "knight_hacks_point_store_purchase",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["attendee_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_point_store_purchase_actor_id_auth_user_id_fk": {
+ "name": "knight_hacks_point_store_purchase_actor_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_point_store_purchase",
+ "tableTo": "auth_user",
+ "columnsFrom": ["actor_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_point_store_purchase_voided_by_auth_user_id_fk": {
+ "name": "knight_hacks_point_store_purchase_voided_by_auth_user_id_fk",
+ "tableFrom": "knight_hacks_point_store_purchase",
+ "tableTo": "auth_user",
+ "columnsFrom": ["voided_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "point_store_purchase_item_fk": {
+ "name": "point_store_purchase_item_fk",
+ "tableFrom": "knight_hacks_point_store_purchase",
+ "tableTo": "knight_hacks_point_store_item",
+ "columnsFrom": ["item_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "point_store_purchase_amount_check": {
+ "name": "point_store_purchase_amount_check",
+ "value": "\"knight_hacks_point_store_purchase\".\"unit_price\" BETWEEN 0 AND 1000000 AND \"knight_hacks_point_store_purchase\".\"quantity\" BETWEEN 1 AND 1000 AND \"knight_hacks_point_store_purchase\".\"total\" = \"knight_hacks_point_store_purchase\".\"unit_price\" * \"knight_hacks_point_store_purchase\".\"quantity\""
+ },
+ "point_store_purchase_void_check": {
+ "name": "point_store_purchase_void_check",
+ "value": "(\"knight_hacks_point_store_purchase\".\"voided_at\" IS NULL AND NOT \"knight_hacks_point_store_purchase\".\"restocked\") OR \"knight_hacks_point_store_purchase\".\"voided_at\" IS NOT NULL"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_print_job": {
+ "name": "knight_hacks_print_job",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hacker_attendee_id": {
+ "name": "hacker_attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(2000)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'received'"
+ },
+ "status_note": {
+ "name": "status_note",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "status_changed_at": {
+ "name": "status_changed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "status_changed_by_user_id": {
+ "name": "status_changed_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "estimated_ready_at": {
+ "name": "estimated_ready_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_print_job_queue_idx": {
+ "name": "knight_hacks_print_job_queue_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_print_job_attendee_idx": {
+ "name": "knight_hacks_print_job_attendee_idx",
+ "columns": [
+ {
+ "expression": "hacker_attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_print_job_status_changed_by_idx": {
+ "name": "knight_hacks_print_job_status_changed_by_idx",
+ "columns": [
+ {
+ "expression": "status_changed_by_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_print_job_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_print_job_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_print_job",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_print_job_status_changed_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_print_job_status_changed_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_print_job",
+ "tableTo": "auth_user",
+ "columnsFrom": ["status_changed_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_print_job_attendee_scope_fk": {
+ "name": "knight_hacks_print_job_attendee_scope_fk",
+ "tableFrom": "knight_hacks_print_job",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["hacker_attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_print_job_scoped_identity_unique": {
+ "name": "knight_hacks_print_job_scoped_identity_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id", "hacker_attendee_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_print_job_status_check": {
+ "name": "knight_hacks_print_job_status_check",
+ "value": "\"knight_hacks_print_job\".\"status\" IN ('received', 'printing', 'needs_clarification', 'ready_for_pickup', 'picked_up', 'cancelled')"
+ },
+ "knight_hacks_print_job_description_not_blank_check": {
+ "name": "knight_hacks_print_job_description_not_blank_check",
+ "value": "\"knight_hacks_print_job\".\"description\" ~ '[^[:space:]]'"
+ },
+ "knight_hacks_print_job_clarification_note_check": {
+ "name": "knight_hacks_print_job_clarification_note_check",
+ "value": "\"knight_hacks_print_job\".\"status\" <> 'needs_clarification' OR (\"knight_hacks_print_job\".\"status_note\" IS NOT NULL AND \"knight_hacks_print_job\".\"status_note\" ~ '[^[:space:]]')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_print_job_file": {
+ "name": "knight_hacks_print_job_file",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "print_job_id": {
+ "name": "print_job_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hacker_attendee_id": {
+ "name": "hacker_attendee_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "object_name": {
+ "name": "object_name",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content_type": {
+ "name": "content_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_print_job_file_job_idx": {
+ "name": "knight_hacks_print_job_file_job_idx",
+ "columns": [
+ {
+ "expression": "print_job_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_print_job_file_attendee_idx": {
+ "name": "knight_hacks_print_job_file_attendee_idx",
+ "columns": [
+ {
+ "expression": "hacker_attendee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_print_job_file_staged_idx": {
+ "name": "knight_hacks_print_job_file_staged_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"knight_hacks_print_job_file\".\"print_job_id\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_print_job_file_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_print_job_file_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_print_job_file",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_print_job_file_attendee_scope_fk": {
+ "name": "knight_hacks_print_job_file_attendee_scope_fk",
+ "tableFrom": "knight_hacks_print_job_file",
+ "tableTo": "knight_hacks_hacker_attendee",
+ "columnsFrom": ["hacker_attendee_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_print_job_file_job_scope_fk": {
+ "name": "knight_hacks_print_job_file_job_scope_fk",
+ "tableFrom": "knight_hacks_print_job_file",
+ "tableTo": "knight_hacks_print_job",
+ "columnsFrom": ["print_job_id", "hackathon_id", "hacker_attendee_id"],
+ "columnsTo": ["id", "hackathon_id", "hacker_attendee_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_print_job_file_object_unique": {
+ "name": "knight_hacks_print_job_file_object_unique",
+ "nullsNotDistinct": false,
+ "columns": ["object_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_print_job_file_size_check": {
+ "name": "knight_hacks_print_job_file_size_check",
+ "value": "\"knight_hacks_print_job_file\".\"size\" > 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_printing_configuration": {
+ "name": "knight_hacks_printing_configuration",
+ "schema": "",
+ "columns": {
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "discord_channel_id": {
+ "name": "discord_channel_id",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submissions_enabled": {
+ "name": "submissions_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "submissions_open_at": {
+ "name": "submissions_open_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submissions_close_at": {
+ "name": "submissions_close_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "print_minutes": {
+ "name": "print_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 60
+ },
+ "printer_count": {
+ "name": "printer_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_printing_configuration_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_printing_configuration_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_printing_configuration",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_printing_configuration_print_minutes_check": {
+ "name": "knight_hacks_printing_configuration_print_minutes_check",
+ "value": "\"knight_hacks_printing_configuration\".\"print_minutes\" BETWEEN 5 AND 600"
+ },
+ "knight_hacks_printing_configuration_printer_count_check": {
+ "name": "knight_hacks_printing_configuration_printer_count_check",
+ "value": "\"knight_hacks_printing_configuration\".\"printer_count\" BETWEEN 1 AND 20"
+ },
+ "knight_hacks_printing_configuration_channel_id_check": {
+ "name": "knight_hacks_printing_configuration_channel_id_check",
+ "value": "\"knight_hacks_printing_configuration\".\"discord_channel_id\" IS NULL OR \"knight_hacks_printing_configuration\".\"discord_channel_id\" ~ '^[0-9]{17,20}$'"
+ },
+ "knight_hacks_printing_configuration_window_check": {
+ "name": "knight_hacks_printing_configuration_window_check",
+ "value": "\"knight_hacks_printing_configuration\".\"submissions_open_at\" IS NULL OR \"knight_hacks_printing_configuration\".\"submissions_close_at\" IS NULL OR \"knight_hacks_printing_configuration\".\"submissions_open_at\" < \"knight_hacks_printing_configuration\".\"submissions_close_at\""
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project": {
+ "name": "knight_hacks_project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "submission_url": {
+ "name": "submission_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "demo_links": {
+ "name": "demo_links",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "video_url": {
+ "name": "video_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "technologies": {
+ "name": "technologies",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "universities": {
+ "name": "universities",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "prize_categories": {
+ "name": "prize_categories",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "ARRAY[]::text[]"
+ },
+ "participant_count": {
+ "name": "participant_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_created_at": {
+ "name": "project_created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deleted_by_user_id": {
+ "name": "deleted_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_project_hackathon_idx": {
+ "name": "knight_hacks_project_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_project_hackathon_deleted_idx": {
+ "name": "knight_hacks_project_hackathon_deleted_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deleted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_project_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_project_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_project",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_deleted_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_project_deleted_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_project",
+ "tableTo": "auth_user",
+ "columnsFrom": ["deleted_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_project_hackathon_submission_url_unique": {
+ "name": "knight_hacks_project_hackathon_submission_url_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id", "submission_url"]
+ },
+ "knight_hacks_project_id_hackathon_unique": {
+ "name": "knight_hacks_project_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_project_participant_count_check": {
+ "name": "knight_hacks_project_participant_count_check",
+ "value": "\"knight_hacks_project\".\"participant_count\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_challenge": {
+ "name": "knight_hacks_project_challenge",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_group": {
+ "name": "is_group",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "import_label_prefix": {
+ "name": "import_label_prefix",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_general": {
+ "name": "is_general",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_scheduled": {
+ "name": "is_scheduled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "is_remote": {
+ "name": "is_remote",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_project_challenge_hackathon_idx": {
+ "name": "knight_hacks_project_challenge_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_project_challenge_hackathon_id_knight_hacks_hackathon_id_fk": {
+ "name": "knight_hacks_project_challenge_hackathon_id_knight_hacks_hackathon_id_fk",
+ "tableFrom": "knight_hacks_project_challenge",
+ "tableTo": "knight_hacks_hackathon",
+ "columnsFrom": ["hackathon_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "project_challenge_parent_scope_fk": {
+ "name": "project_challenge_parent_scope_fk",
+ "tableFrom": "knight_hacks_project_challenge",
+ "tableTo": "knight_hacks_project_challenge",
+ "columnsFrom": ["parent_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_project_challenge_hackathon_label_unique": {
+ "name": "knight_hacks_project_challenge_hackathon_label_unique",
+ "nullsNotDistinct": false,
+ "columns": ["hackathon_id", "label", "is_group"]
+ },
+ "knight_hacks_project_challenge_id_hackathon_unique": {
+ "name": "knight_hacks_project_challenge_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "project_challenge_root_general": {
+ "name": "project_challenge_root_general",
+ "value": "NOT \"knight_hacks_project_challenge\".\"is_general\" OR \"knight_hacks_project_challenge\".\"parent_id\" IS NULL"
+ },
+ "project_challenge_not_self": {
+ "name": "project_challenge_not_self",
+ "value": "\"knight_hacks_project_challenge\".\"parent_id\" IS NULL OR \"knight_hacks_project_challenge\".\"parent_id\" <> \"knight_hacks_project_challenge\".\"id\""
+ },
+ "project_challenge_mode_check": {
+ "name": "project_challenge_mode_check",
+ "value": "NOT (\"knight_hacks_project_challenge\".\"is_scheduled\" AND \"knight_hacks_project_challenge\".\"is_remote\")"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_claim": {
+ "name": "knight_hacks_project_claim",
+ "schema": "",
+ "columns": {
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_project_claim_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_project_claim_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_project_claim",
+ "tableTo": "auth_user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "project_claim_member_scope_fk": {
+ "name": "project_claim_member_scope_fk",
+ "tableFrom": "knight_hacks_project_claim",
+ "tableTo": "knight_hacks_project_member",
+ "columnsFrom": ["member_id", "project_id"],
+ "columnsTo": ["id", "project_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "project_claim_project_scope_fk": {
+ "name": "project_claim_project_scope_fk",
+ "tableFrom": "knight_hacks_project_claim",
+ "tableTo": "knight_hacks_project",
+ "columnsFrom": ["project_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "project_claim_user_event_unique": {
+ "name": "project_claim_user_event_unique",
+ "nullsNotDistinct": false,
+ "columns": ["user_id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_claim_link": {
+ "name": "knight_hacks_project_claim_link",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consumed_by_user_id": {
+ "name": "consumed_by_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consumed_at": {
+ "name": "consumed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sent_at": {
+ "name": "sent_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_project_claim_link_member_id_knight_hacks_project_member_id_fk": {
+ "name": "knight_hacks_project_claim_link_member_id_knight_hacks_project_member_id_fk",
+ "tableFrom": "knight_hacks_project_claim_link",
+ "tableTo": "knight_hacks_project_member",
+ "columnsFrom": ["member_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_claim_link_consumed_by_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_project_claim_link_consumed_by_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_project_claim_link",
+ "tableTo": "auth_user",
+ "columnsFrom": ["consumed_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "project_claim_link_member_unique": {
+ "name": "project_claim_link_member_unique",
+ "nullsNotDistinct": false,
+ "columns": ["member_id"]
+ },
+ "project_claim_link_token_unique": {
+ "name": "project_claim_link_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "project_claim_link_consumed_check": {
+ "name": "project_claim_link_consumed_check",
+ "value": "(\"knight_hacks_project_claim_link\".\"consumed_at\" IS NULL AND \"knight_hacks_project_claim_link\".\"consumed_by_user_id\" IS NULL AND \"knight_hacks_project_claim_link\".\"token\" IS NOT NULL) OR (\"knight_hacks_project_claim_link\".\"consumed_at\" IS NOT NULL AND \"knight_hacks_project_claim_link\".\"consumed_by_user_id\" IS NOT NULL AND \"knight_hacks_project_claim_link\".\"token\" IS NULL)"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_evaluation": {
+ "name": "knight_hacks_project_evaluation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "challenge_id": {
+ "name": "challenge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "judge_id": {
+ "name": "judge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "is_complete": {
+ "name": "is_complete",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "appointment_id": {
+ "name": "appointment_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auto_submitted_at": {
+ "name": "auto_submitted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_project_evaluation_project_challenge_idx": {
+ "name": "knight_hacks_project_evaluation_project_challenge_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "challenge_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_project_evaluation_judge_idx": {
+ "name": "knight_hacks_project_evaluation_judge_idx",
+ "columns": [
+ {
+ "expression": "judge_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_project_evaluation_appointment_fk": {
+ "name": "knight_hacks_project_evaluation_appointment_fk",
+ "tableFrom": "knight_hacks_project_evaluation",
+ "tableTo": "knight_hacks_judging_appointment",
+ "columnsFrom": ["appointment_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_evaluation_project_challenge_scope_fk": {
+ "name": "knight_hacks_project_evaluation_project_challenge_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation",
+ "tableTo": "knight_hacks_project_to_challenge",
+ "columnsFrom": ["project_id", "challenge_id", "hackathon_id"],
+ "columnsTo": ["project_id", "challenge_id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_evaluation_judge_scope_fk": {
+ "name": "knight_hacks_project_evaluation_judge_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation",
+ "tableTo": "knight_hacks_judge",
+ "columnsFrom": ["judge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_project_evaluation_judge_project_challenge_unique": {
+ "name": "knight_hacks_project_evaluation_judge_project_challenge_unique",
+ "nullsNotDistinct": false,
+ "columns": ["judge_id", "project_id", "challenge_id"]
+ },
+ "knight_hacks_project_evaluation_id_hackathon_unique": {
+ "name": "knight_hacks_project_evaluation_id_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_evaluation_draft": {
+ "name": "knight_hacks_project_evaluation_draft",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "challenge_id": {
+ "name": "challenge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "judge_id": {
+ "name": "judge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "appointment_id": {
+ "name": "appointment_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_id": {
+ "name": "evaluation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "base_evaluation_revision": {
+ "name": "base_evaluation_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ratings": {
+ "name": "ratings",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "responses": {
+ "name": "responses",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "deadline_at": {
+ "name": "deadline_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reconciliation_failed_at": {
+ "name": "reconciliation_failed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reconciliation_error_code": {
+ "name": "reconciliation_error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knight_hacks_evaluation_draft_due_idx": {
+ "name": "knight_hacks_evaluation_draft_due_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "deadline_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_project_evaluation_draft_evaluation_id_knight_hacks_project_evaluation_id_fk": {
+ "name": "knight_hacks_project_evaluation_draft_evaluation_id_knight_hacks_project_evaluation_id_fk",
+ "tableFrom": "knight_hacks_project_evaluation_draft",
+ "tableTo": "knight_hacks_project_evaluation",
+ "columnsFrom": ["evaluation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_evaluation_draft_appointment_fk": {
+ "name": "knight_hacks_evaluation_draft_appointment_fk",
+ "tableFrom": "knight_hacks_project_evaluation_draft",
+ "tableTo": "knight_hacks_judging_appointment",
+ "columnsFrom": ["appointment_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_evaluation_draft_project_fk": {
+ "name": "knight_hacks_evaluation_draft_project_fk",
+ "tableFrom": "knight_hacks_project_evaluation_draft",
+ "tableTo": "knight_hacks_project_to_challenge",
+ "columnsFrom": ["project_id", "challenge_id", "hackathon_id"],
+ "columnsTo": ["project_id", "challenge_id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_evaluation_draft_judge_fk": {
+ "name": "knight_hacks_evaluation_draft_judge_fk",
+ "tableFrom": "knight_hacks_project_evaluation_draft",
+ "tableTo": "knight_hacks_judge",
+ "columnsFrom": ["judge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_evaluation_draft_author_unique": {
+ "name": "knight_hacks_evaluation_draft_author_unique",
+ "nullsNotDistinct": false,
+ "columns": ["judge_id", "project_id", "challenge_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_evaluation_rating": {
+ "name": "knight_hacks_project_evaluation_rating",
+ "schema": "",
+ "columns": {
+ "evaluation_id": {
+ "name": "evaluation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rubric_item_id": {
+ "name": "rubric_item_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_project_evaluation_rating_evaluation_scope_fk": {
+ "name": "knight_hacks_project_evaluation_rating_evaluation_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation_rating",
+ "tableTo": "knight_hacks_project_evaluation",
+ "columnsFrom": ["evaluation_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_evaluation_rating_rubric_scope_fk": {
+ "name": "knight_hacks_project_evaluation_rating_rubric_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation_rating",
+ "tableTo": "knight_hacks_judging_rubric_item",
+ "columnsFrom": ["rubric_item_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_project_evaluation_rating_evaluation_id_rubric_item_id_pk": {
+ "name": "knight_hacks_project_evaluation_rating_evaluation_id_rubric_item_id_pk",
+ "columns": ["evaluation_id", "rubric_item_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_project_evaluation_rating_value_check": {
+ "name": "knight_hacks_project_evaluation_rating_value_check",
+ "value": "\"knight_hacks_project_evaluation_rating\".\"value\" BETWEEN 1 AND 5"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_evaluation_response": {
+ "name": "knight_hacks_project_evaluation_response",
+ "schema": "",
+ "columns": {
+ "evaluation_id": {
+ "name": "evaluation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rubric_item_id": {
+ "name": "rubric_item_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_public": {
+ "name": "is_public",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_project_evaluation_response_evaluation_scope_fk": {
+ "name": "knight_hacks_project_evaluation_response_evaluation_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation_response",
+ "tableTo": "knight_hacks_project_evaluation",
+ "columnsFrom": ["evaluation_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_evaluation_response_rubric_scope_fk": {
+ "name": "knight_hacks_project_evaluation_response_rubric_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation_response",
+ "tableTo": "knight_hacks_judging_rubric_item",
+ "columnsFrom": ["rubric_item_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_project_evaluation_response_evaluation_id_rubric_item_id_pk": {
+ "name": "knight_hacks_project_evaluation_response_evaluation_id_rubric_item_id_pk",
+ "columns": ["evaluation_id", "rubric_item_id"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_evaluation_revision": {
+ "name": "knight_hacks_project_evaluation_revision",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "evaluation_id": {
+ "name": "evaluation_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_kind": {
+ "name": "actor_kind",
+ "type": "judge_kind",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rating_answers": {
+ "name": "rating_answers",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "response_answers": {
+ "name": "response_answers",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_project_evaluation_revision_evaluation_scope_fk": {
+ "name": "knight_hacks_project_evaluation_revision_evaluation_scope_fk",
+ "tableFrom": "knight_hacks_project_evaluation_revision",
+ "tableTo": "knight_hacks_project_evaluation",
+ "columnsFrom": ["evaluation_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_project_evaluation_revision_unique": {
+ "name": "knight_hacks_project_evaluation_revision_unique",
+ "nullsNotDistinct": false,
+ "columns": ["evaluation_id", "revision"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_project_evaluation_revision_revision_check": {
+ "name": "knight_hacks_project_evaluation_revision_revision_check",
+ "value": "\"knight_hacks_project_evaluation_revision\".\"revision\" >= 1"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_member": {
+ "name": "knight_hacks_project_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(320)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "display_order": {
+ "name": "display_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "invited_user_id": {
+ "name": "invited_user_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "knight_hacks_project_member_project_idx": {
+ "name": "knight_hacks_project_member_project_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_project_member_project_id_knight_hacks_project_id_fk": {
+ "name": "knight_hacks_project_member_project_id_knight_hacks_project_id_fk",
+ "tableFrom": "knight_hacks_project_member",
+ "tableTo": "knight_hacks_project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_member_invited_user_id_auth_user_id_fk": {
+ "name": "knight_hacks_project_member_invited_user_id_auth_user_id_fk",
+ "tableFrom": "knight_hacks_project_member",
+ "tableTo": "auth_user",
+ "columnsFrom": ["invited_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "restrict",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "project_member_id_project_unique": {
+ "name": "project_member_id_project_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "project_id"]
+ },
+ "knight_hacks_project_member_project_order_unique": {
+ "name": "knight_hacks_project_member_project_order_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "display_order"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "knight_hacks_project_member_display_order_check": {
+ "name": "knight_hacks_project_member_display_order_check",
+ "value": "\"knight_hacks_project_member\".\"display_order\" >= 0"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_project_to_challenge": {
+ "name": "knight_hacks_project_to_challenge",
+ "schema": "",
+ "columns": {
+ "project_id": {
+ "name": "project_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "challenge_id": {
+ "name": "challenge_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hackathon_id": {
+ "name": "hackathon_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_opt_in": {
+ "name": "is_opt_in",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ }
+ },
+ "indexes": {
+ "knight_hacks_project_to_challenge_challenge_idx": {
+ "name": "knight_hacks_project_to_challenge_challenge_idx",
+ "columns": [
+ {
+ "expression": "challenge_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knight_hacks_project_to_challenge_hackathon_idx": {
+ "name": "knight_hacks_project_to_challenge_hackathon_idx",
+ "columns": [
+ {
+ "expression": "hackathon_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knight_hacks_project_to_challenge_project_scope_fk": {
+ "name": "knight_hacks_project_to_challenge_project_scope_fk",
+ "tableFrom": "knight_hacks_project_to_challenge",
+ "tableTo": "knight_hacks_project",
+ "columnsFrom": ["project_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knight_hacks_project_to_challenge_challenge_scope_fk": {
+ "name": "knight_hacks_project_to_challenge_challenge_scope_fk",
+ "tableFrom": "knight_hacks_project_to_challenge",
+ "tableTo": "knight_hacks_project_challenge",
+ "columnsFrom": ["challenge_id", "hackathon_id"],
+ "columnsTo": ["id", "hackathon_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "knight_hacks_project_to_challenge_project_id_challenge_id_pk": {
+ "name": "knight_hacks_project_to_challenge_project_id_challenge_id_pk",
+ "columns": ["project_id", "challenge_id"]
+ }
+ },
+ "uniqueConstraints": {
+ "knight_hacks_project_to_challenge_project_challenge_hackathon_unique": {
+ "name": "knight_hacks_project_to_challenge_project_challenge_hackathon_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "challenge_id", "hackathon_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_sponsor": {
+ "name": "knight_hacks_sponsor",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo_url": {
+ "name": "logo_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "website_url": {
+ "name": "website_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_template": {
+ "name": "knight_hacks_template",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "normalized_name": {
+ "name": "normalized_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "body": {
+ "name": "body",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "disabled_at": {
+ "name": "disabled_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disabled_reason": {
+ "name": "disabled_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "knight_hacks_template_normalized_name_unique": {
+ "name": "knight_hacks_template_normalized_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["normalized_name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knight_hacks_trpc_form_connection": {
+ "name": "knight_hacks_trpc_form_connection",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "form": {
+ "name": "form",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "proc": {
+ "name": "proc",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "connections": {
+ "name": "connections",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "knight_hacks_trpc_form_connection_form_knight_hacks_form_schemas_id_fk": {
+ "name": "knight_hacks_trpc_form_connection_form_knight_hacks_form_schemas_id_fk",
+ "tableFrom": "knight_hacks_trpc_form_connection",
+ "tableTo": "knight_hacks_form_schemas",
+ "columnsFrom": ["form"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.alumni_bulletin_state": {
+ "name": "alumni_bulletin_state",
+ "schema": "public",
+ "values": ["draft", "published", "archived"]
+ },
+ "public.company_review_state": {
+ "name": "company_review_state",
+ "schema": "public",
+ "values": ["pending", "approved", "rejected", "merged"]
+ },
+ "public.employment_experience_type": {
+ "name": "employment_experience_type",
+ "schema": "public",
+ "values": [
+ "internship",
+ "full_time",
+ "part_time",
+ "co_op",
+ "contract",
+ "fellowship",
+ "self_employed",
+ "other"
+ ]
+ },
+ "public.employment_state": {
+ "name": "employment_state",
+ "schema": "public",
+ "values": ["current", "past", "unknown"]
+ },
+ "public.event_discord_entity_type": {
+ "name": "event_discord_entity_type",
+ "schema": "public",
+ "values": ["external", "voice", "stage"]
+ },
+ "public.event_google_destination": {
+ "name": "event_google_destination",
+ "schema": "public",
+ "values": ["public", "internal"]
+ },
+ "public.event_publication_work_state": {
+ "name": "event_publication_work_state",
+ "schema": "public",
+ "values": ["pending", "processing", "succeeded", "failed", "blocked"]
+ },
+ "public.event_purpose": {
+ "name": "event_purpose",
+ "schema": "public",
+ "values": ["event", "primary_check_in"]
+ },
+ "public.event_sync_state": {
+ "name": "event_sync_state",
+ "schema": "public",
+ "values": ["disabled", "pending", "synced", "error", "unknown"]
+ },
+ "public.form_callback_status": {
+ "name": "form_callback_status",
+ "schema": "public",
+ "values": ["pending", "running", "succeeded", "failed", "cancelled"]
+ },
+ "public.form_kind": {
+ "name": "form_kind",
+ "schema": "public",
+ "values": ["general", "event_feedback", "system"]
+ },
+ "public.form_response_mode": {
+ "name": "form_response_mode",
+ "schema": "public",
+ "values": ["single_locked", "single_editable", "multiple_locked"]
+ },
+ "public.form_state": {
+ "name": "form_state",
+ "schema": "public",
+ "values": ["draft", "published", "archived"]
+ },
+ "public.gender": {
+ "name": "gender",
+ "schema": "public",
+ "values": [
+ "Man",
+ "Woman",
+ "Non-binary",
+ "Prefer to self-describe",
+ "Prefer not to answer"
+ ]
+ },
+ "public.hackathon_application_state": {
+ "name": "hackathon_application_state",
+ "schema": "public",
+ "values": [
+ "withdrawn",
+ "pending",
+ "accepted",
+ "waitlisted",
+ "checkedin",
+ "confirmed",
+ "denied"
+ ]
+ },
+ "public.hackathon_event_publication_provider": {
+ "name": "hackathon_event_publication_provider",
+ "schema": "public",
+ "values": ["discord", "google"]
+ },
+ "public.hackathon_event_reminder_state": {
+ "name": "hackathon_event_reminder_state",
+ "schema": "public",
+ "values": ["pending", "delivering", "delivered", "failed", "unknown"]
+ },
+ "public.hacker_agreement_provenance": {
+ "name": "hacker_agreement_provenance",
+ "schema": "public",
+ "values": ["explicit", "legacy_unversioned"]
+ },
+ "public.hacker_agreement_stage": {
+ "name": "hacker_agreement_stage",
+ "schema": "public",
+ "values": ["application", "confirmation"]
+ },
+ "public.hacker_check_in_outcome": {
+ "name": "hacker_check_in_outcome",
+ "schema": "public",
+ "values": [
+ "checked_in",
+ "already_checked_in",
+ "invalid_qr",
+ "hacker_not_found",
+ "wrong_status",
+ "not_checked_in",
+ "wrong_class",
+ "not_ready"
+ ]
+ },
+ "public.hacker_discord_role_attempt_outcome": {
+ "name": "hacker_discord_role_attempt_outcome",
+ "schema": "public",
+ "values": ["pending", "succeeded", "failed", "unknown"]
+ },
+ "public.hacker_discord_role_grant_state": {
+ "name": "hacker_discord_role_grant_state",
+ "schema": "public",
+ "values": ["pending", "succeeded", "failed", "unknown"]
+ },
+ "public.hacker_discord_role_kind": {
+ "name": "hacker_discord_role_kind",
+ "schema": "public",
+ "values": ["general", "class", "vip"]
+ },
+ "public.hacker_participant_command_state": {
+ "name": "hacker_participant_command_state",
+ "schema": "public",
+ "values": ["started", "completed"]
+ },
+ "public.issue_priority": {
+ "name": "issue_priority",
+ "schema": "public",
+ "values": ["Lowest", "Low", "Medium", "High", "Highest"]
+ },
+ "public.issue_status": {
+ "name": "issue_status",
+ "schema": "public",
+ "values": ["Backlog", "Planning", "In Progress", "Finished"]
+ },
+ "public.judge_kind": {
+ "name": "judge_kind",
+ "schema": "public",
+ "values": ["member", "guest"]
+ },
+ "public.judging_response_visibility": {
+ "name": "judging_response_visibility",
+ "schema": "public",
+ "values": ["public", "public_optional", "private"]
+ },
+ "public.judging_rubric_item_kind": {
+ "name": "judging_rubric_item_kind",
+ "schema": "public",
+ "values": ["rating", "short_response"]
+ },
+ "public.judging_state": {
+ "name": "judging_state",
+ "schema": "public",
+ "values": ["draft", "open", "closed"]
+ },
+ "public.race_or_ethnicity": {
+ "name": "race_or_ethnicity",
+ "schema": "public",
+ "values": [
+ "White",
+ "Black or African American",
+ "Hispanic / Latino / Spanish Origin",
+ "Asian",
+ "Native Hawaiian or Other Pacific Islander",
+ "Native American or Alaskan Native",
+ "Middle Eastern",
+ "Prefer not to answer",
+ "Other"
+ ]
+ },
+ "public.shirt_size": {
+ "name": "shirt_size",
+ "schema": "public",
+ "values": ["XS", "S", "M", "L", "XL", "2XL", "3XL"]
+ },
+ "public.sponsor_tier": {
+ "name": "sponsor_tier",
+ "schema": "public",
+ "values": ["gold", "silver", "bronze", "other"]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json
index cc216bb75..3e527c4eb 100644
--- a/packages/db/drizzle/meta/_journal.json
+++ b/packages/db/drizzle/meta/_journal.json
@@ -435,6 +435,13 @@
"when": 1791473519514,
"tag": "0061_tidy_the_hood",
"breakpoints": true
+ },
+ {
+ "idx": 62,
+ "version": "7",
+ "when": 1791630825458,
+ "tag": "0062_little_slipstream",
+ "breakpoints": true
}
]
}
diff --git a/packages/db/src/schemas/knight-hacks.ts b/packages/db/src/schemas/knight-hacks.ts
index 6d73bab48..bef2e38f3 100644
--- a/packages/db/src/schemas/knight-hacks.ts
+++ b/packages/db/src/schemas/knight-hacks.ts
@@ -4427,8 +4427,8 @@ export type SelectPrintJobFile = typeof PrintJobFile.$inferSelect;
/**
* Per-hackathon printing settings. A missing row and a NULL channel both mean
- * no Discord notices; jobs still work. A missing row means the default
- * estimate settings.
+ * no Discord notices. A missing row means default estimate settings and closed
+ * hacker submissions until an admin explicitly opens them.
*/
export const PrintingConfiguration = createTable(
"printing_configuration",
@@ -4440,6 +4440,12 @@ export const PrintingConfiguration = createTable(
.references(() => Hackathon.id, { onDelete: "cascade" }),
/** Organizer-only channel that receives new-job notices. */
discordChannelId: t.varchar({ length: 20 }),
+ /** Admin-controlled gate for creating new hacker print requests. */
+ submissionsEnabled: t.boolean().notNull().default(false),
+ /** Optional time when hacker submissions start being accepted. */
+ submissionsOpenAt: t.timestamp({ withTimezone: true }),
+ /** Optional time when hacker submissions stop being accepted. */
+ submissionsCloseAt: t.timestamp({ withTimezone: true }),
/** Minutes one print is assumed to take, for ready-time estimates. */
printMinutes: t.integer().notNull().default(PRINTING.DEFAULT_PRINT_MINUTES),
/** Printers working the queue at once, for ready-time estimates. */
@@ -4459,6 +4465,10 @@ export const PrintingConfiguration = createTable(
"knight_hacks_printing_configuration_channel_id_check",
sql`${table.discordChannelId} IS NULL OR ${table.discordChannelId} ~ '^[0-9]{17,20}$'`,
),
+ validSubmissionWindow: check(
+ "knight_hacks_printing_configuration_window_check",
+ sql`${table.submissionsOpenAt} IS NULL OR ${table.submissionsCloseAt} IS NULL OR ${table.submissionsOpenAt} < ${table.submissionsCloseAt}`,
+ ),
}),
);
diff --git a/packages/validators/src/audit.ts b/packages/validators/src/audit.ts
index 8050ed328..333b38e6b 100644
--- a/packages/validators/src/audit.ts
+++ b/packages/validators/src/audit.ts
@@ -889,6 +889,12 @@ export const AUDIT_ACTION_CATALOG = {
[],
["printMinutes", "printerCount"],
),
+ "printing.submissions.updated": policy(
+ "hackathons",
+ "Updated 3D printing submission hours",
+ [],
+ ["submissionsEnabled", "submissionsOpenAt", "submissionsCloseAt"],
+ ),
"hacker.check_in_pass_issued": policy(
"hackathons",
"Issued hacker check-in pass",
diff --git a/packages/validators/src/hacker-portal.ts b/packages/validators/src/hacker-portal.ts
index cb232c81d..19aa7af1e 100644
--- a/packages/validators/src/hacker-portal.ts
+++ b/packages/validators/src/hacker-portal.ts
@@ -484,6 +484,14 @@ export const printJobsDtoSchema = z
/** Minutes until a job submitted now would be ready. */
estimatedWaitMinutes: z.number().int().min(0),
printMinutes: z.number().int().min(1),
+ submissions: z
+ .object({
+ closeAt: nullableIsoDateTimeSchema,
+ enabled: z.boolean(),
+ isOpen: z.boolean(),
+ openAt: nullableIsoDateTimeSchema,
+ })
+ .strict(),
waitingCount: z.number().int().min(0),
})
.strict(),
@@ -581,6 +589,7 @@ export const participantDomainErrorSchema = z
"INVALID_PRINT_FILE",
"INVALID_RESUME",
"PRINT_FILE_UNAVAILABLE",
+ "PRINTING_CLOSED",
"PRINT_JOB_NOT_CANCELLABLE",
"SESSION_EXPIRED",
"STALE_PROFILE_REVISION",
diff --git a/packages/validators/src/printing.ts b/packages/validators/src/printing.ts
index ef07de950..fa0f0017a 100644
--- a/packages/validators/src/printing.ts
+++ b/packages/validators/src/printing.ts
@@ -67,6 +67,25 @@ export const printingSetChannelInputSchema = z
})
.strict();
+export const printingSetSubmissionWindowInputSchema = z
+ .object({
+ closeAt: z.date().nullable(),
+ enabled: z.boolean(),
+ hackathonId: uuidSchema,
+ openAt: z.date().nullable(),
+ })
+ .strict()
+ .refine(
+ (input) =>
+ input.openAt === null ||
+ input.closeAt === null ||
+ input.openAt.getTime() < input.closeAt.getTime(),
+ {
+ message: "Open time must be before close time.",
+ path: ["closeAt"],
+ },
+ );
+
export const printingSetEstimateSettingsInputSchema = z
.object({
hackathonId: uuidSchema,