From 92459122c5807fedb87f723ca2b5fc6bfd53a571 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Tue, 29 Sep 2026 16:57:21 +0200 Subject: [PATCH] feat(server): convert legacy style rules with a manual script instead of at startup The conversion of stored legacy style rules to Semantic CSS no longer runs when the server starts. The image now ships apps/server/dist/migrate-legacy-styles.mjs, run by hand against DATABASE_URL: - without flags it's a dry run that converts in memory and reports counts - --apply --backup converts, appending every replaced stylesheet to the backup file before its row is written - --restore puts those stylesheets back, except on rows edited since Each table is scanned once for the rows that need converting, then they're converted in batches with progress logged. Only metadata.stylesheet is rewritten, a row whose stylesheet changed after it was read is left alone, and running it again skips what's converted. The data_migration table that recorded the startup run is gone. The self-hosting guide explains the one-time run. --- apps/server/src/migrate-legacy-styles.ts | 69 + apps/server/src/startup/checks.ts | 10 - apps/server/tsdown.config.ts | 7 +- docs/self-hosting/docker.mdx | 25 + .../migration.sql | 4 - .../snapshot.json | 7183 ----------------- .../resume/legacy-styles-migration.ts | 163 +- packages/db/src/schema/data-migration.ts | 10 - packages/db/src/schema/index.ts | 1 - 9 files changed, 216 insertions(+), 7256 deletions(-) create mode 100644 apps/server/src/migrate-legacy-styles.ts delete mode 100644 migrations/20260929141848_data_migrations/migration.sql delete mode 100644 migrations/20260929141848_data_migrations/snapshot.json delete mode 100644 packages/db/src/schema/data-migration.ts diff --git a/apps/server/src/migrate-legacy-styles.ts b/apps/server/src/migrate-legacy-styles.ts new file mode 100644 index 000000000..44e493048 --- /dev/null +++ b/apps/server/src/migrate-legacy-styles.ts @@ -0,0 +1,69 @@ +import type { StylesheetChange } from "@reactive-resume/api/features/resume/legacy-styles-migration"; +import { closeSync, openSync, readFileSync, writeSync } from "node:fs"; +import { parseArgs } from "node:util"; +import { drizzle } from "drizzle-orm/node-postgres"; +import { Pool } from "pg"; +import { migrateLegacyStyles, restoreLegacyStyles } from "@reactive-resume/api/features/resume/legacy-styles-migration"; +import { env } from "@reactive-resume/env/server"; + +const usage = `Converts resumes and letters still styled by the old style editor (legacy style rules) to Semantic CSS. +Uses DATABASE_URL. Run it once after deploying the version without the legacy renderer. + + node apps/server/dist/migrate-legacy-styles.mjs + Dry run: converts every row that needs it in memory and reports the counts. Writes nothing. + + node apps/server/dist/migrate-legacy-styles.mjs --apply --backup + Converts and saves. Every replaced stylesheet is appended to (NDJSON) before its row is written. + Safe to run again or after an interruption: converted rows are skipped. Use a new file or the same one. + + node apps/server/dist/migrate-legacy-styles.mjs --restore + Puts back the stylesheets recorded in , except on rows whose stylesheet was edited since. +`; + +const { values } = parseArgs({ + options: { + apply: { type: "boolean", default: false }, + backup: { type: "string" }, + restore: { type: "string" }, + help: { type: "boolean", default: false }, + }, +}); + +if (values.help || (values.apply && !values.backup) || (values.restore && (values.apply || values.backup))) { + console.info(usage); + process.exit(values.help ? 0 : 1); +} + +// Opened before connecting, so an unwritable path fails before anything changes. +const backup = values.backup ? openSync(values.backup, "a") : undefined; + +const pool = new Pool({ connectionString: env.DATABASE_URL, max: 1, connectionTimeoutMillis: 10_000 }); +const client = await pool.connect(); +const log = (message: string) => console.info(`[${new Date().toISOString()}] ${message}`); + +try { + // Finding the rows is one scan per table, which can outlast the database's default statement timeout. + await client.query("SET statement_timeout = 0"); + const db = drizzle({ client }); + + if (values.restore) { + const changes = readFileSync(values.restore, "utf8") + .split("\n") + .filter((line) => line.trim()) + .map((line) => JSON.parse(line) as StylesheetChange); + log(`Restoring ${changes.length} stylesheets from ${values.restore}`); + log(`Done: ${JSON.stringify(await restoreLegacyStyles(db, changes))}`); + } else { + log(values.apply ? `Converting, backing up to ${values.backup}` : "Dry run: nothing will be written"); + const summary = await migrateLegacyStyles(db, { + apply: values.apply, + log, + ...(backup === undefined ? {} : { onChange: (change) => writeSync(backup, `${JSON.stringify(change)}\n`) }), + }); + log(`Done: ${JSON.stringify(summary)}`); + } +} finally { + if (backup !== undefined) closeSync(backup); + client.release(); + await pool.end(); +} diff --git a/apps/server/src/startup/checks.ts b/apps/server/src/startup/checks.ts index 0b61ef473..62afe3936 100644 --- a/apps/server/src/startup/checks.ts +++ b/apps/server/src/startup/checks.ts @@ -5,7 +5,6 @@ import { fileURLToPath } from "node:url"; import { drizzle } from "drizzle-orm/node-postgres"; import { migrate } from "drizzle-orm/node-postgres/migrator"; import { Pool } from "pg"; -import { migrateLegacyStyles } from "@reactive-resume/api/features/resume/legacy-styles-migration"; import { env } from "@reactive-resume/env/server"; import { getLocalDataDirectory } from "@reactive-resume/utils/monorepo.node"; import { verifyMigratedSchema } from "./schema-check"; @@ -48,15 +47,6 @@ export async function runDatabaseMigrations() { throw error; } - // Data migrations need app code, so they run here, once, after the SQL ones. A failure leaves the data as it - // was (legacy-styled resumes render unstyled until it's retried on the next start), so it doesn't stop startup. - try { - const summary = await migrateLegacyStyles(db); - if (summary) console.info("Legacy style rules converted to Semantic CSS", summary); - } catch (error) { - console.error("Converting legacy style rules failed; it will be retried on the next start", { error }); - } - // Post-migration verification is not a migration failure, so it gets its own log // message. A drifted schema still lets the server boot; STRICT_SCHEMA_CHECK=true // makes the drift fatal instead. diff --git a/apps/server/tsdown.config.ts b/apps/server/tsdown.config.ts index fa403a1a5..a8222a3c0 100644 --- a/apps/server/tsdown.config.ts +++ b/apps/server/tsdown.config.ts @@ -62,7 +62,12 @@ const promptAssetsPlugin: TsdownPlugin = { }; export default defineConfig({ - entry: { index: "src/index.ts", vercel: "src/vercel.ts", "prepare-deployment": "src/prepare-deployment.ts" }, + entry: { + index: "src/index.ts", + vercel: "src/vercel.ts", + "prepare-deployment": "src/prepare-deployment.ts", + "migrate-legacy-styles": "src/migrate-legacy-styles.ts", + }, // Keep import.meta.url-based asset lookup adjacent to the entrypoints. outputOptions: { chunkFileNames: "[name]-[hash].mjs" }, format: "esm", diff --git a/docs/self-hosting/docker.mdx b/docs/self-hosting/docker.mdx index 6fe7e2cb5..bfd9db7c3 100644 --- a/docs/self-hosting/docker.mdx +++ b/docs/self-hosting/docker.mdx @@ -459,6 +459,31 @@ through your managed provider, then follow that image's, host's, or provider's u and verify that the backup can be restored before a major-version upgrade. Pulling a new app image and running app migrations do not upgrade the PostgreSQL server. +### Converting styles from the old style editor (one time) + +Resumes and cover letters styled with the old style editor (before Custom Styles became CSS) keep those styles only once +they're converted to Custom Styles. The conversion isn't run automatically: after updating to the first version without +the old editor, run it once from the app container. It uses the container's `DATABASE_URL`. + +1. **Dry run.** Converts every affected resume in memory and reports the counts; nothing is written. + + ```bash + docker compose exec reactive-resume node apps/server/dist/migrate-legacy-styles.mjs + ``` + +2. **Convert.** Every replaced stylesheet is saved to the backup file first. Only the stylesheet of each resume or letter + changes, and running it again (for example after an interruption) skips what's already converted. + + ```bash + docker compose exec reactive-resume node apps/server/dist/migrate-legacy-styles.mjs --apply --backup /app/data/legacy-styles-backup.ndjson + ``` + +3. **Undo, if needed.** Puts back the recorded stylesheets, except on resumes edited since. + + ```bash + docker compose exec reactive-resume node apps/server/dist/migrate-legacy-styles.mjs --restore /app/data/legacy-styles-backup.ndjson + ``` + ## Backups (recommended) Reactive Resume stores data in two places: the PostgreSQL database and file uploads (either local storage or S3). Back up both on a regular schedule. diff --git a/migrations/20260929141848_data_migrations/migration.sql b/migrations/20260929141848_data_migrations/migration.sql deleted file mode 100644 index 866520fa5..000000000 --- a/migrations/20260929141848_data_migrations/migration.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE TABLE "data_migration" ( - "name" text PRIMARY KEY, - "completed_at" timestamp with time zone DEFAULT now() NOT NULL -); diff --git a/migrations/20260929141848_data_migrations/snapshot.json b/migrations/20260929141848_data_migrations/snapshot.json deleted file mode 100644 index 56d4903bb..000000000 --- a/migrations/20260929141848_data_migrations/snapshot.json +++ /dev/null @@ -1,7183 +0,0 @@ -{ - "version": "8", - "dialect": "postgres", - "id": "d9820346-c07e-4fb2-85be-49ae3dd2fa24", - "prevIds": ["1ef1e6a5-1186-4c75-8fbf-4833ee1b8dd7"], - "ddl": [ - { - "isRlsEnabled": false, - "name": "agent_actions", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "agent_attachments", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "agent_messages", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "agent_threads", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "ai_providers", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "application", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "account", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "apikey", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "jwks", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_access_token", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_client", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_client_assertion", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_client_resource", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_consent", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_refresh_token", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "oauth_resource", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "passkey", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "session", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "two_factor", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "user", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "verification", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "cover_letter", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "cover_letter_version", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "data_migration", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "resume", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "resume_slug_redirect", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "resume_statistics", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "resume_statistics_daily", - "entityType": "tables", - "schema": "public" - }, - { - "isRlsEnabled": false, - "name": "resume_version", - "entityType": "tables", - "schema": "public" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "thread_id", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "message_id", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_id", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "kind", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'applied'", - "generated": null, - "identity": null, - "name": "status", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "title", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "summary", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "operations", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "snapshot_data", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "base_updated_at", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "applied_updated_at", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "reverted_at", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "revert_message", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "agent_actions" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "thread_id", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "message_id", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "storage_key", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "filename", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "media_type", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "size", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "agent_attachments" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "thread_id", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "role", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'completed'", - "generated": null, - "identity": null, - "name": "status", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "sequence", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "ui_message", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "error", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "agent_messages" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "ai_provider_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "source_resume_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "working_resume_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "cover_letter_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "title", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "edits_proposed", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "edits_accepted", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'active'", - "generated": null, - "identity": null, - "name": "status", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "review_patches", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "active_run_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "active_stream_id", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "active_run_started_at", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "last_message_at", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "archived_at", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "deleted_at", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "agent_threads" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "label", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "provider", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "model", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "base_url", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "encrypted_api_key", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "api_key_salt", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "api_key_hash", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "api_key_preview", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'untested'", - "generated": null, - "identity": null, - "name": "test_status", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "test_error", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_tested_at", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_used_at", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "enabled", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "ai_providers" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "company", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "role", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "location", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "salary", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'saved'", - "generated": null, - "identity": null, - "name": "status", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "closed_reason", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_id", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "cover_letter_id", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "sent_resume_version_id", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "smallint", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "sent_check_score", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "sent_cover_letter_version_id", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "source", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": "'{}'", - "generated": null, - "identity": null, - "name": "tags", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "source_url", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "job_description", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'[]'", - "generated": null, - "identity": null, - "name": "requirements", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "match_score", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "ai_metadata", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "notes", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_file_url", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_file_name", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "cover_letter_url", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "cover_letter_name", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "follow_up_at", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "follow_up_note", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'[]'", - "generated": null, - "identity": null, - "name": "contacts", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'[]'", - "generated": null, - "identity": null, - "name": "activity", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "applied_at", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "application" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "account_id", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'credential'", - "generated": null, - "identity": null, - "name": "provider_id", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "issuer", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "scope", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id_token", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "password", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "access_token", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "refresh_token", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "access_token_expires_at", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "refresh_token_expires_at", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "account" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "start", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "prefix", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "key", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'default'", - "generated": null, - "identity": null, - "name": "config_id", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "reference_id", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "refill_interval", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "refill_amount", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_refill_at", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "true", - "generated": null, - "identity": null, - "name": "enabled", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "rate_limit_enabled", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "86400000", - "generated": null, - "identity": null, - "name": "rate_limit_time_window", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "10", - "generated": null, - "identity": null, - "name": "rate_limit_max", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "request_count", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "remaining", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_request", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "permissions", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "metadata", - "entityType": "columns", - "schema": "public", - "table": "apikey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "public_key", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "private_key", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "alg", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "crv", - "entityType": "columns", - "schema": "public", - "table": "jwks" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "authorization_code_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "resources", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "requested_user_info_claims", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "revoked", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "confirmation", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "token", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "session_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "reference_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "refresh_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "scopes", - "entityType": "columns", - "schema": "public", - "table": "oauth_access_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_discovery_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": "'{}'", - "generated": null, - "identity": null, - "name": "client_credentials_scopes", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "backchannel_logout_uri", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "backchannel_logout_session_required", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "application_type", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "jwks", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "jwks_uri", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "dpop_bound_access_tokens", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_secret", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "disabled", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "skip_consent", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "enable_end_session", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "subject_type", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "scopes", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "uri", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "icon", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "contacts", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "tos", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "policy", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "software_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "software_version", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "software_statement", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "redirect_uris", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "post_logout_redirect_uris", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "token_endpoint_auth_method", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "grant_types", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "response_types", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "public", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "type", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "require_pkce", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "reference_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "metadata", - "entityType": "columns", - "schema": "public", - "table": "oauth_client" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_assertion" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_assertion" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resource_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "metadata", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "resources", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "requested_user_info_claims", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "reference_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "scopes", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_consent" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "authorization_code_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "resources", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "requested_user_info_claims", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "rotated_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "rotation_replay_response", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "rotation_replay_expires_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "confirmation", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "token", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "client_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "session_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "reference_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "revoked", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "auth_time", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "scopes", - "entityType": "columns", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "identifier", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "access_token_ttl", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "refresh_token_ttl", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "signing_algorithm", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "signing_key_id", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 1, - "default": null, - "generated": null, - "identity": null, - "name": "allowed_scopes", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "custom_claims", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "dpop_bound_access_tokens_required", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "disabled", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "1", - "generated": null, - "identity": null, - "name": "policy_version", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "metadata", - "entityType": "columns", - "schema": "public", - "table": "oauth_resource" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "aaguid", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "public_key", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "credential_id", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "counter", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "device_type", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "backed_up", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "transports", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "passkey" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "token", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "ip_address", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_agent", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "impersonated_by", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "session" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "secret", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "backup_codes", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "true", - "generated": null, - "identity": null, - "name": "verified", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "failed_verification_count", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "locked_until", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "two_factor" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "image", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "email", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "email_verified", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "username", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "display_username", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "two_factor_enabled", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_active_at", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "'user'", - "generated": null, - "identity": null, - "name": "role", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "banned", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "ban_reason", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "timestamp(6) with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "ban_expires", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "user" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "verification" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "identifier", - "entityType": "columns", - "schema": "public", - "table": "verification" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "value", - "entityType": "columns", - "schema": "public", - "table": "verification" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "verification" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "verification" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "verification" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "''", - "generated": null, - "identity": null, - "name": "recipient", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "''", - "generated": null, - "identity": null, - "name": "content", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "style", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'freeform'", - "generated": null, - "identity": null, - "name": "layout", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "''", - "generated": null, - "identity": null, - "name": "recipient_name", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "''", - "generated": null, - "identity": null, - "name": "recipient_company", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "letter_date", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "sender_linked", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "design_linked", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "source_resume_id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "source_application_id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": "'{}'", - "generated": null, - "identity": null, - "name": "tags", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "is_locked", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "trashed_at", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "1", - "generated": null, - "identity": null, - "name": "revision", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "cover_letter" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "cover_letter_id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "data", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'auto'", - "generated": null, - "identity": null, - "name": "kind", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "session_id", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "cover_letter_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "data_migration" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "completed_at", - "entityType": "columns", - "schema": "public", - "table": "data_migration" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "slug", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 1, - "default": "'{}'", - "generated": null, - "identity": null, - "name": "tags", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "is_public", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "true", - "generated": null, - "identity": null, - "name": "show_download_buttons", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "is_locked", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "password", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "application_id", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "trashed_at", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "boolean", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "false", - "generated": null, - "identity": null, - "name": "auto_name", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "data", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "resume" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "slug", - "entityType": "columns", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_id", - "entityType": "columns", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "expires_at", - "entityType": "columns", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "views", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "downloads", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_viewed_at", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "last_downloaded_at", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_id", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "date", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "date", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "views", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "integer", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "0", - "generated": null, - "identity": null, - "name": "downloads", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_id", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "updated_at", - "entityType": "columns", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "id", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "resume_id", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "user_id", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "jsonb", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "data", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "'auto'", - "generated": null, - "identity": null, - "name": "kind", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "name", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "text", - "typeSchema": null, - "notNull": false, - "dimensions": 0, - "default": null, - "generated": null, - "identity": null, - "name": "session_id", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "type": "timestamp with time zone", - "typeSchema": null, - "notNull": true, - "dimensions": 0, - "default": "now()", - "generated": null, - "identity": null, - "name": "created_at", - "entityType": "columns", - "schema": "public", - "table": "resume_version" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "thread_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "created_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_actions_thread_id_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "resume_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_actions_resume_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "message_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_actions_message_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "thread_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_attachments_thread_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_attachments" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "message_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_attachments_message_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_attachments" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_attachments_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_attachments" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "thread_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "sequence", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": true, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_messages_thread_id_sequence_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_messages" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "created_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_messages_user_id_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_messages" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "status", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "last_message_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_threads_user_id_status_last_message_at_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "working_resume_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_threads_working_resume_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "cover_letter_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_threads_cover_letter_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "ai_provider_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "agent_threads_ai_provider_id_index", - "entityType": "indexes", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "enabled", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "ai_providers_user_id_enabled_index", - "entityType": "indexes", - "schema": "public", - "table": "ai_providers" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "last_used_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "ai_providers_user_id_last_used_at_index", - "entityType": "indexes", - "schema": "public", - "table": "ai_providers" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "created_at", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "ai_providers_user_id_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "ai_providers" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "application_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "updated_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "application_user_id_updated_at_index", - "entityType": "indexes", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "account_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "account" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "reference_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "apikey_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "apikey" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "key", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "apikey_key_index", - "entityType": "indexes", - "schema": "public", - "table": "apikey" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "config_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "apikey_config_id_index", - "entityType": "indexes", - "schema": "public", - "table": "apikey" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "enabled", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "reference_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "apikey_enabled_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "apikey" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "token", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_access_token_token_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_access_token" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "client_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_client_client_id_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_client" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "client_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_client_resource_client_id_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "resource_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_client_resource_resource_id_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "client_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "resource_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": true, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_client_resource_client_id_resource_id_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "client_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_consent_user_id_client_id_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_consent" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "token", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "oauth_refresh_token_token_index", - "entityType": "indexes", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "passkey_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "passkey" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "token", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "session_token_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "session" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "expires_at", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "session_expires_at_index", - "entityType": "indexes", - "schema": "public", - "table": "session" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "two_factor_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "two_factor" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "secret", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "two_factor_secret_index", - "entityType": "indexes", - "schema": "public", - "table": "two_factor" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "created_at", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "user_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "user" - }, - { - "nameExplicit": true, - "columns": [ - { - "value": "lower(\"email\")", - "isExpression": true, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": true, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "user_email_lower_unique_idx", - "entityType": "indexes", - "schema": "public", - "table": "user" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "identifier", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "verification_identifier_index", - "entityType": "indexes", - "schema": "public", - "table": "verification" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "updated_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - }, - { - "value": "id", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "cover_letter_user_id_updated_at_id_index", - "entityType": "indexes", - "schema": "public", - "table": "cover_letter" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "cover_letter_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "created_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "cover_letter_version_cover_letter_id_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "cover_letter_version" - }, - { - "nameExplicit": true, - "columns": [ - { - "value": "cover_letter_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "session_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": true, - "where": "\"kind\" = 'auto'", - "with": "", - "method": "btree", - "concurrently": false, - "name": "cover_letter_version_session_unique", - "entityType": "indexes", - "schema": "public", - "table": "cover_letter_version" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "created_at", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "resume" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "updated_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_user_id_updated_at_index", - "entityType": "indexes", - "schema": "public", - "table": "resume" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "is_public", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "slug", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "user_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_is_public_slug_user_id_index", - "entityType": "indexes", - "schema": "public", - "table": "resume" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "resume_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_slug_redirect_resume_id_index", - "entityType": "indexes", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "resume_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "date", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_statistics_daily_resume_id_date_index", - "entityType": "indexes", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "nameExplicit": false, - "columns": [ - { - "value": "resume_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "created_at", - "isExpression": false, - "asc": false, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": false, - "where": null, - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_version_resume_id_created_at_index", - "entityType": "indexes", - "schema": "public", - "table": "resume_version" - }, - { - "nameExplicit": true, - "columns": [ - { - "value": "resume_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - }, - { - "value": "session_id", - "isExpression": false, - "asc": true, - "nullsFirst": false, - "opclass": null - } - ], - "isUnique": true, - "where": "\"kind\" = 'auto'", - "with": "", - "method": "btree", - "concurrently": false, - "name": "resume_version_session_unique", - "entityType": "indexes", - "schema": "public", - "table": "resume_version" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_actions_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": ["thread_id"], - "schemaTo": "public", - "tableTo": "agent_threads", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_actions_thread_id_agent_threads_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": ["message_id"], - "schemaTo": "public", - "tableTo": "agent_messages", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_actions_message_id_agent_messages_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_actions_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_actions" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_attachments_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_attachments" - }, - { - "nameExplicit": false, - "columns": ["thread_id"], - "schemaTo": "public", - "tableTo": "agent_threads", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_attachments_thread_id_agent_threads_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_attachments" - }, - { - "nameExplicit": false, - "columns": ["message_id"], - "schemaTo": "public", - "tableTo": "agent_messages", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_attachments_message_id_agent_messages_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_attachments" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_messages_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_messages" - }, - { - "nameExplicit": false, - "columns": ["thread_id"], - "schemaTo": "public", - "tableTo": "agent_threads", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_messages_thread_id_agent_threads_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_messages" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "agent_threads_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": ["ai_provider_id"], - "schemaTo": "public", - "tableTo": "ai_providers", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_threads_ai_provider_id_ai_providers_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": ["source_resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_threads_source_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": ["working_resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_threads_working_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": ["cover_letter_id"], - "schemaTo": "public", - "tableTo": "cover_letter", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "agent_threads_cover_letter_id_cover_letter_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "agent_threads" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "ai_providers_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "ai_providers" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "application_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "application_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": ["cover_letter_id"], - "schemaTo": "public", - "tableTo": "cover_letter", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "application_cover_letter_id_cover_letter_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": ["sent_resume_version_id"], - "schemaTo": "public", - "tableTo": "resume_version", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "application_sent_resume_version_id_resume_version_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": ["sent_cover_letter_version_id"], - "schemaTo": "public", - "tableTo": "cover_letter_version", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "application_QJaGmijrxJ0T_fkey", - "entityType": "fks", - "schema": "public", - "table": "application" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "account_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "account" - }, - { - "nameExplicit": false, - "columns": ["reference_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "apikey_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "apikey" - }, - { - "nameExplicit": false, - "columns": ["client_id"], - "schemaTo": "public", - "tableTo": "oauth_client", - "columnsTo": ["client_id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_access_token_client_id_oauth_client_client_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_access_token" - }, - { - "nameExplicit": false, - "columns": ["session_id"], - "schemaTo": "public", - "tableTo": "session", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "oauth_access_token_session_id_session_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_access_token" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_access_token_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_access_token" - }, - { - "nameExplicit": false, - "columns": ["refresh_id"], - "schemaTo": "public", - "tableTo": "oauth_refresh_token", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_access_token_refresh_id_oauth_refresh_token_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_access_token" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_client_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_client" - }, - { - "nameExplicit": false, - "columns": ["client_id"], - "schemaTo": "public", - "tableTo": "oauth_client", - "columnsTo": ["client_id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_client_resource_client_id_oauth_client_client_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "nameExplicit": false, - "columns": ["resource_id"], - "schemaTo": "public", - "tableTo": "oauth_resource", - "columnsTo": ["identifier"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_client_resource_dn2L1gs9Dolm_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_client_resource" - }, - { - "nameExplicit": false, - "columns": ["client_id"], - "schemaTo": "public", - "tableTo": "oauth_client", - "columnsTo": ["client_id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_consent_client_id_oauth_client_client_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_consent" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_consent_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_consent" - }, - { - "nameExplicit": false, - "columns": ["client_id"], - "schemaTo": "public", - "tableTo": "oauth_client", - "columnsTo": ["client_id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_refresh_token_client_id_oauth_client_client_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "nameExplicit": false, - "columns": ["session_id"], - "schemaTo": "public", - "tableTo": "session", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "oauth_refresh_token_session_id_session_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "oauth_refresh_token_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "oauth_refresh_token" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "passkey_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "passkey" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "session_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "session" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "two_factor_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "two_factor" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "cover_letter_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "cover_letter" - }, - { - "nameExplicit": false, - "columns": ["source_resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "cover_letter_source_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "cover_letter" - }, - { - "nameExplicit": false, - "columns": ["source_application_id"], - "schemaTo": "public", - "tableTo": "application", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "cover_letter_source_application_id_application_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "cover_letter" - }, - { - "nameExplicit": false, - "columns": ["cover_letter_id"], - "schemaTo": "public", - "tableTo": "cover_letter", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "cover_letter_version_cover_letter_id_cover_letter_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "cover_letter_version" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "cover_letter_version_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "cover_letter_version" - }, - { - "nameExplicit": false, - "columns": ["application_id"], - "schemaTo": "public", - "tableTo": "application", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "SET NULL", - "name": "resume_application_id_application_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_slug_redirect_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_slug_redirect_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_statistics_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume_statistics" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_statistics_daily_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "schemaTo": "public", - "tableTo": "resume", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_version_resume_id_resume_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume_version" - }, - { - "nameExplicit": false, - "columns": ["user_id"], - "schemaTo": "public", - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "NO ACTION", - "onDelete": "CASCADE", - "name": "resume_version_user_id_user_id_fkey", - "entityType": "fks", - "schema": "public", - "table": "resume_version" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "agent_actions_pkey", - "schema": "public", - "table": "agent_actions", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "agent_attachments_pkey", - "schema": "public", - "table": "agent_attachments", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "agent_messages_pkey", - "schema": "public", - "table": "agent_messages", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "agent_threads_pkey", - "schema": "public", - "table": "agent_threads", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "ai_providers_pkey", - "schema": "public", - "table": "ai_providers", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "application_pkey", - "schema": "public", - "table": "application", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "account_pkey", - "schema": "public", - "table": "account", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "apikey_pkey", - "schema": "public", - "table": "apikey", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "jwks_pkey", - "schema": "public", - "table": "jwks", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_access_token_pkey", - "schema": "public", - "table": "oauth_access_token", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_client_pkey", - "schema": "public", - "table": "oauth_client", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_client_assertion_pkey", - "schema": "public", - "table": "oauth_client_assertion", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_client_resource_pkey", - "schema": "public", - "table": "oauth_client_resource", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_consent_pkey", - "schema": "public", - "table": "oauth_consent", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_refresh_token_pkey", - "schema": "public", - "table": "oauth_refresh_token", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "oauth_resource_pkey", - "schema": "public", - "table": "oauth_resource", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "passkey_pkey", - "schema": "public", - "table": "passkey", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "session_pkey", - "schema": "public", - "table": "session", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "two_factor_pkey", - "schema": "public", - "table": "two_factor", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "user_pkey", - "schema": "public", - "table": "user", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "verification_pkey", - "schema": "public", - "table": "verification", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "cover_letter_pkey", - "schema": "public", - "table": "cover_letter", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "cover_letter_version_pkey", - "schema": "public", - "table": "cover_letter_version", - "entityType": "pks" - }, - { - "columns": ["name"], - "nameExplicit": false, - "name": "data_migration_pkey", - "schema": "public", - "table": "data_migration", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "resume_pkey", - "schema": "public", - "table": "resume", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "resume_slug_redirect_pkey", - "schema": "public", - "table": "resume_slug_redirect", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "resume_statistics_pkey", - "schema": "public", - "table": "resume_statistics", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "resume_statistics_daily_pkey", - "schema": "public", - "table": "resume_statistics_daily", - "entityType": "pks" - }, - { - "columns": ["id"], - "nameExplicit": false, - "name": "resume_version_pkey", - "schema": "public", - "table": "resume_version", - "entityType": "pks" - }, - { - "nameExplicit": false, - "columns": ["slug", "user_id"], - "nullsNotDistinct": false, - "name": "resume_slug_user_id_unique", - "entityType": "uniques", - "schema": "public", - "table": "resume" - }, - { - "nameExplicit": false, - "columns": ["user_id", "slug"], - "nullsNotDistinct": false, - "name": "resume_slug_redirect_user_id_slug_unique", - "entityType": "uniques", - "schema": "public", - "table": "resume_slug_redirect" - }, - { - "nameExplicit": false, - "columns": ["resume_id", "date"], - "nullsNotDistinct": false, - "name": "resume_statistics_daily_resume_id_date_unique", - "entityType": "uniques", - "schema": "public", - "table": "resume_statistics_daily" - }, - { - "nameExplicit": false, - "columns": ["token"], - "nullsNotDistinct": false, - "name": "oauth_access_token_token_key", - "schema": "public", - "table": "oauth_access_token", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["client_id"], - "nullsNotDistinct": false, - "name": "oauth_client_client_id_key", - "schema": "public", - "table": "oauth_client", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["identifier"], - "nullsNotDistinct": false, - "name": "oauth_resource_identifier_key", - "schema": "public", - "table": "oauth_resource", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["token"], - "nullsNotDistinct": false, - "name": "session_token_key", - "schema": "public", - "table": "session", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["email"], - "nullsNotDistinct": false, - "name": "user_email_key", - "schema": "public", - "table": "user", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["username"], - "nullsNotDistinct": false, - "name": "user_username_key", - "schema": "public", - "table": "user", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["display_username"], - "nullsNotDistinct": false, - "name": "user_display_username_key", - "schema": "public", - "table": "user", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["identifier"], - "nullsNotDistinct": false, - "name": "verification_identifier_key", - "schema": "public", - "table": "verification", - "entityType": "uniques" - }, - { - "nameExplicit": false, - "columns": ["resume_id"], - "nullsNotDistinct": false, - "name": "resume_statistics_resume_id_key", - "schema": "public", - "table": "resume_statistics", - "entityType": "uniques" - } - ], - "renames": [] -} diff --git a/packages/api/src/features/resume/legacy-styles-migration.ts b/packages/api/src/features/resume/legacy-styles-migration.ts index 05b1fdd82..a992e3f28 100644 --- a/packages/api/src/features/resume/legacy-styles-migration.ts +++ b/packages/api/src/features/resume/legacy-styles-migration.ts @@ -3,7 +3,6 @@ import type { NodePgDatabase } from "drizzle-orm/node-postgres"; import { sql } from "drizzle-orm"; import { migrateLetterStylesheet, migrateResumeStylesheet } from "./legacy-styles"; -const MIGRATION = "2026-09-legacy-style-rules-to-semantic-css"; const BATCH = 200; type Target = { @@ -21,72 +20,142 @@ const TARGETS: readonly Target[] = [ { table: "cover_letter_version", column: "data", owner: ["style"], convert: migrateLetterStylesheet }, ]; -type Summary = Record; +/** One row's stylesheet before and after conversion: enough to put it back. `before` is the stored JSON text, or null when there was none. */ +export type StylesheetChange = { + table: string; + id: string; + before: string | null; + after: SemanticStylesheet; +}; + +export type MigrateLegacyStylesOptions = { + /** Without it nothing is written: rows are only converted and counted. */ + apply: boolean; + /** Receives each change right before it's written, so it can be backed up first. */ + onChange?: (change: StylesheetChange) => void; + log?: (message: string) => void; +}; + +type Counts = { candidates: number; migrated: number; changed: number; failed: number }; +export type MigrateLegacyStylesSummary = Record; const jsonPath = (...keys: string[]) => sql.raw(`'{${keys.join(",")}}'`); -/** - * Converts every stored legacy style (old editor rules, or a legacy-mode stylesheet) to Semantic CSS, once. It only - * rewrites `metadata.stylesheet` (the rules stay, for rollback), skips a row whose stylesheet changed since it was - * read (retrying it next startup), and records itself in `data_migration` once nothing is left so later startups - * skip it. A row whose data doesn't parse is left as it is and counted. Runs under the startup migration lock, so one server does it. - */ -export async function migrateLegacyStyles(db: NodePgDatabase): Promise { - const done = await db.execute(sql`SELECT 1 FROM "data_migration" WHERE "name" = ${MIGRATION}`); - if (done.rows.length > 0) return null; - - const summary: Summary = {}; - for (const target of TARGETS) { - const counts = { migrated: 0, skipped: 0, failed: 0 }; - summary[target.table] = counts; - const table = sql.identifier(target.table); - const column = sql.identifier(target.column); - const metadata = jsonPath(...target.owner, "metadata"); - const stylesheetPath = jsonPath(...target.owner, "metadata", "stylesheet"); - const needsMigration = sql`( - ${column} #>> ${jsonPath(...target.owner, "metadata", "stylesheet", "mode")} = 'legacy' - OR ( - jsonb_typeof(${column} #> ${stylesheetPath}) IS DISTINCT FROM 'object' - AND jsonb_typeof(${column} #> ${jsonPath(...target.owner, "metadata", "styleRules")}) = 'array' - AND jsonb_array_length(${column} #> ${jsonPath(...target.owner, "metadata", "styleRules")}) > 0 +const targetSql = (target: Target) => { + const column = sql.identifier(target.column); + const path = (...keys: string[]) => jsonPath(...target.owner, ...keys); + const stylesheetPath = path("metadata", "stylesheet"); + return { + table: sql.identifier(target.table), + column, + owner: jsonPath(...target.owner), + stylesheetPath, + // Mirrors `needsLegacyStyleConversion`: still in the old editor's legacy mode, or legacy rules and no stylesheet. + needsMigration: sql`( + jsonb_typeof(${column} #> ${path("metadata")}) = 'object' + AND ( + ${column} #>> ${path("metadata", "stylesheet", "mode")} = 'legacy' + OR ( + jsonb_typeof(${column} #> ${stylesheetPath}) IS DISTINCT FROM 'object' + AND jsonb_typeof(${column} #> ${path("metadata", "styleRules")}) = 'array' + AND jsonb_array_length(${column} #> ${path("metadata", "styleRules")}) > 0 + ) ) - )`; + )`, + }; +}; - let after = ""; - for (;;) { - const batch = await db.execute<{ id: string; owner: unknown; stylesheet: unknown }>(sql` - SELECT "id", ${column} #> ${jsonPath(...target.owner)} AS "owner", ${column} #> ${stylesheetPath} AS "stylesheet" +/** + * Converts every stored legacy style (old editor rules, or a legacy-mode stylesheet) to Semantic CSS. Only + * `metadata.stylesheet` is rewritten, in place, so edits to the rest of a row aren't lost and the rules stay for + * rollback. A row whose stylesheet changed after it was read is left alone (it's counted as `changed`; running again + * picks it up if it still needs it), and one whose data doesn't parse is left as it is (`failed`). Safe to run again: + * a converted row no longer matches. + * + * Each table is scanned once for the rows that need it, so it takes a connection without a statement timeout. + */ +export async function migrateLegacyStyles( + db: NodePgDatabase, + { apply, onChange, log = () => {} }: MigrateLegacyStylesOptions, +): Promise { + const summary: MigrateLegacyStylesSummary = {}; + + for (const target of TARGETS) { + const { table, column, owner, stylesheetPath, needsMigration } = targetSql(target); + const found = await db.execute<{ id: string }>( + sql`SELECT "id" FROM ${table} WHERE ${needsMigration} ORDER BY "id"`, + ); + const ids = found.rows.map((row) => row.id); + const counts: Counts = { candidates: ids.length, migrated: 0, changed: 0, failed: 0 }; + summary[target.table] = counts; + log(`${target.table}: ${ids.length} rows need converting`); + + for (let start = 0; start < ids.length; start += BATCH) { + const batch = await db.execute<{ id: string; owner: unknown; stylesheet: string | null }>(sql` + SELECT "id", ${column} #> ${owner} AS "owner", (${column} #> ${stylesheetPath})::text AS "stylesheet" FROM ${table} - WHERE "id" > ${after} AND jsonb_typeof(${column} #> ${metadata}) = 'object' AND ${needsMigration} - ORDER BY "id" - LIMIT ${BATCH} + WHERE "id" IN (SELECT jsonb_array_elements_text(${JSON.stringify(ids.slice(start, start + BATCH))}::jsonb)) + AND ${needsMigration} `); - if (batch.rows.length === 0) break; + counts.changed += Math.min(BATCH, ids.length - start) - batch.rows.length; for (const row of batch.rows) { - after = row.id; - let stylesheet: SemanticStylesheet | null; + let after: SemanticStylesheet | null; try { - stylesheet = target.convert(row.owner); - } catch { + after = target.convert(row.owner); + } catch (error) { counts.failed++; + log(`${target.table} ${row.id}: not converted, ${String((error as Error)?.message ?? error).slice(0, 200)}`); continue; } - if (!stylesheet) continue; + if (!after) continue; + if (!apply) { + counts.migrated++; + continue; + } + + onChange?.({ table: target.table, id: row.id, before: row.stylesheet, after }); const updated = await db.execute(sql` UPDATE ${table} - SET ${column} = jsonb_set(${column}, ${stylesheetPath}, ${JSON.stringify(stylesheet)}::jsonb) - WHERE "id" = ${row.id} - AND ${column} #> ${stylesheetPath} IS NOT DISTINCT FROM ${row.stylesheet === null ? null : JSON.stringify(row.stylesheet)}::jsonb + SET ${column} = jsonb_set(${column}, ${stylesheetPath}, ${JSON.stringify(after)}::jsonb) + WHERE "id" = ${row.id} AND (${column} #> ${stylesheetPath}) IS NOT DISTINCT FROM ${row.stylesheet}::jsonb `); if (updated.rowCount) counts.migrated++; - else counts.skipped++; + else counts.changed++; } + log( + `${target.table}: ${Math.min(start + BATCH, ids.length)}/${ids.length} (${apply ? "converted" : "would convert"} ${counts.migrated}, changed meanwhile ${counts.changed}, failed ${counts.failed})`, + ); } } - // A row that changed while it was being migrated is picked up next startup; one whose data doesn't parse never will. - if (Object.values(summary).every(({ skipped }) => skipped === 0)) - await db.execute(sql`INSERT INTO "data_migration" ("name") VALUES (${MIGRATION}) ON CONFLICT DO NOTHING`); return summary; } + +/** + * Puts back the stylesheets `migrateLegacyStyles` replaced, from the changes it reported. A row whose stylesheet + * isn't the converted one any more (edited since) is left alone and counted as `changed`. + */ +export async function restoreLegacyStyles( + db: NodePgDatabase, + changes: Iterable, +): Promise<{ restored: number; changed: number }> { + const counts = { restored: 0, changed: 0 }; + for (const change of changes) { + const target = TARGETS.find(({ table }) => table === change.table); + if (!target) throw new Error(`Unknown table in backup: ${change.table}`); + const { table, column, stylesheetPath } = targetSql(target); + const restored = + change.before === null + ? sql`${column} #- ${stylesheetPath}` + : sql`jsonb_set(${column}, ${stylesheetPath}, ${change.before}::jsonb)`; + const updated = await db.execute(sql` + UPDATE ${table} + SET ${column} = ${restored} + WHERE "id" = ${change.id} AND (${column} #> ${stylesheetPath}) = ${JSON.stringify(change.after)}::jsonb + `); + if (updated.rowCount) counts.restored++; + else counts.changed++; + } + return counts; +} diff --git a/packages/db/src/schema/data-migration.ts b/packages/db/src/schema/data-migration.ts deleted file mode 100644 index 33f29ee6e..000000000 --- a/packages/db/src/schema/data-migration.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as pg from "drizzle-orm/pg-core"; - -/** - * Data migrations that run in code at startup, after the SQL migrations (converting stored data needs app code). Each - * is recorded here once it has finished, so later startups skip it without scanning the tables again. - */ -export const dataMigration = pg.pgTable("data_migration", { - name: pg.text("name").primaryKey(), - completedAt: pg.timestamp("completed_at", { withTimezone: true }).notNull().defaultNow(), -}); diff --git a/packages/db/src/schema/index.ts b/packages/db/src/schema/index.ts index 14bdd511a..f6fedc862 100644 --- a/packages/db/src/schema/index.ts +++ b/packages/db/src/schema/index.ts @@ -2,5 +2,4 @@ export * from "./agent"; export * from "./applications"; export * from "./auth"; export * from "./cover-letter"; -export * from "./data-migration"; export * from "./resume";