mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-06-22 04:11:55 +10:00
fix: update resume ID type from uuid to text and use generateId for ID generation
This commit is contained in:
@@ -182,7 +182,7 @@ The database schema is defined using Drizzle ORM in `src/integrations/drizzle/sc
|
||||
import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
||||
|
||||
export const resume = pgTable("resume", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
id: text("id").primaryKey().defaultRandom(),
|
||||
title: text("title").notNull(),
|
||||
slug: text("slug").notNull(),
|
||||
// ... more fields
|
||||
|
||||
@@ -5,6 +5,7 @@ import { flattenError, ZodError } from "zod";
|
||||
import { resumeDataSchema } from "@reactive-resume/schema/resume/data";
|
||||
import { defaultResumeData } from "@reactive-resume/schema/resume/default";
|
||||
import { isObject } from "@reactive-resume/utils/sanitize";
|
||||
import { generateId } from "@reactive-resume/utils/string";
|
||||
import { buildAiExtractionTemplate } from "./extraction-template";
|
||||
|
||||
const aiExtractionTemplate = buildAiExtractionTemplate();
|
||||
@@ -206,7 +207,7 @@ function normalizeResumeDataForSchema(data: Record<string, unknown>, diagnostics
|
||||
const normalizedItem = { ...item };
|
||||
if (typeof normalizedItem.id !== "string" || normalizedItem.id.trim().length === 0) {
|
||||
diagnostics.salvageApplied = true;
|
||||
normalizedItem.id = crypto.randomUUID();
|
||||
normalizedItem.id = generateId();
|
||||
}
|
||||
if (typeof normalizedItem.hidden !== "boolean") {
|
||||
diagnostics.salvageApplied = true;
|
||||
|
||||
Reference in New Issue
Block a user