Skip to content

An AI-powered search engine with a generative UI

style: Apply Prettier formatting

Yoshiki Miurac0005d3152d0
diff --git a/drizzle/meta/0005_snapshot.json b/drizzle/meta/0005_snapshot.json
index 8ceede4c..9d3c4795 100644
--- a/drizzle/meta/0005_snapshot.json
+++ b/drizzle/meta/0005_snapshot.json
@@ -189,9 +189,7 @@
"name": "anyone_can_insert_feedback",
"as": "PERMISSIVE",
"for": "INSERT",
- "to": [
- "public"
- ],
+ "to": ["public"],
"withCheck": "true"
}
},
@@ -283,12 +281,8 @@
"name": "messages_chat_id_chats_id_fk",
"tableFrom": "messages",
"tableTo": "chats",
- "columnsFrom": [
- "chat_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chat_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -588,12 +582,8 @@
"name": "parts_message_id_messages_id_fk",
"tableFrom": "parts",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -637,4 +627,4 @@
"schemas": {},
"tables": {}
}
-}
\ No newline at end of file
+}
diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json
index 9c569bb1..18821628 100644
--- a/drizzle/meta/_journal.json
+++ b/drizzle/meta/_journal.json
@@ -45,4 +45,4 @@
"breakpoints": true
}
]
-}
\ No newline at end of file
+}
diff --git a/lib/db/schema.ts b/lib/db/schema.ts
index c23d4936..05631bfc 100644
--- a/lib/db/schema.ts
+++ b/lib/db/schema.ts
@@ -69,10 +69,7 @@ export const messages = pgTable(
},
table => [
index('messages_chat_id_idx').on(table.chatId),
- index('messages_chat_id_created_at_idx').on(
- table.chatId,
- table.createdAt
- )
+ index('messages_chat_id_created_at_idx').on(table.chatId, table.createdAt)
]
).enableRLS()
@@ -161,16 +158,10 @@ export const parts = pgTable(
table => [
// Indexes
index('parts_message_id_idx').on(table.messageId),
- index('parts_message_id_order_idx').on(
- table.messageId,
- table.order
- ),
+ index('parts_message_id_order_idx').on(table.messageId, table.order),
// Constraints
- check(
- 'text_text_required',
- sql`(type != 'text' OR text_text IS NOT NULL)`
- ),
+ check('text_text_required', sql`(type != 'text' OR text_text IS NOT NULL)`),
check(
'reasoning_text_required',
sql`(type != 'reasoning' OR reasoning_text IS NOT NULL)`
@@ -214,7 +205,7 @@ export const feedback = pgTable(
// Indexes
index('feedback_user_id_idx').on(table.userId),
index('feedback_created_at_idx').on(table.createdAt),
-
+
// RLS Policy - Allow anyone to insert feedback
pgPolicy('anyone_can_insert_feedback', {
for: 'insert',