Add authentication check and require user ID for story creation

This commit is contained in:
Riccardo Giorato
2025-12-25 14:21:41 +01:00
parent 8bc68eb102
commit d5b163e586
3 changed files with 29 additions and 18 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ export const stories = pgTable('stories', {
title: text('title').notNull(),
slug: text('slug').notNull().unique(),
description: text('description'),
userId: uuid('user_id'), // Optional - for future Clerk auth
userId: uuid('user_id').notNull(), // Required Clerk user ID
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});