Skip to content

Commit 04e4450

Browse files
Fix bugs mentioned by cursor bugbot
1 parent 233f0a6 commit 04e4450

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/app/actions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export async function sendReportAction(data: SendReportSchema) {
3434
const [report] = await db
3535
.insert(reportsTable)
3636
.values({
37-
id: crypto.randomUUID(),
3837
message: body.message,
3938
repoAuthor: body.repoAuthor,
4039
repoId: body.repoId,

src/env.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export const env = createEnv({
1818
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME:
1919
process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
2020
NEXT_PUBLIC_ANALYTICS_WEBSITE_ID:
21-
process.env.NEXT_PUBLIC_ANALYTICS_WEBSITE_ID,
22-
DATABASE_URL: process.env.DATABASE_URL,
23-
AUTH_DRIZZLE_URL: process.env.AUTH_DRIZZLE_URL
21+
process.env.NEXT_PUBLIC_ANALYTICS_WEBSITE_ID
2422
}
2523
});

src/lib/db/migrations/schema.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ export const sessionsTable = pgTable('nextauth_sessions', {
111111
});
112112

113113
export const bookmarksTable = pgTable('bookmarks', {
114-
id: text().primaryKey().notNull(),
114+
id: text()
115+
.primaryKey()
116+
.notNull()
117+
.notNull()
118+
.$defaultFn(() => crypto.randomUUID()),
115119
userId: text('user_id').references(() => usersTable.id, {
116120
onDelete: 'cascade'
117121
}),
@@ -128,7 +132,10 @@ export const bookmarksTable = pgTable('bookmarks', {
128132
});
129133

130134
export const reportsTable = pgTable('reports', {
131-
id: text().primaryKey().notNull(),
135+
id: text()
136+
.primaryKey()
137+
.notNull()
138+
.$defaultFn(() => crypto.randomUUID()),
132139
repoId: integer().unique(),
133140
repoAuthor: varchar({ length: 255 }),
134141
message: text().default('No Message').notNull(),

0 commit comments

Comments
 (0)