procbay-schema 1.0.69 → 1.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/prisma/json/content-data/industries.json +9 -0
- package/prisma/migrations/20251106061645_removed_chat_schema/migration.sql +25 -0
- package/prisma/schema.prisma +0 -57
- package/prisma/seeders/utils/config.js +1 -1
- package/src/prisma/edge.js +3 -42
- package/src/prisma/index-browser.js +0 -39
- package/src/prisma/index.d.ts +123 -5142
- package/src/prisma/index.js +3 -42
- package/src/prisma/package.json +1 -1
- package/src/prisma/schema.prisma +0 -58
- package/src/prisma/wasm.js +0 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "procbay-schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
4
4
|
"description": "A set of utilities for managing Prisma database schemas, seeding, and maintenance operations for the Procure-to-Pay system",
|
|
5
5
|
"main": "src/prisma/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -79,5 +79,14 @@
|
|
|
79
79
|
"description": "Procurement of fleet, fuel, and logistics support services.",
|
|
80
80
|
"created_by": 1,
|
|
81
81
|
"updated_by": 1
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": 10,
|
|
85
|
+
"name": "Speciality Chemicals",
|
|
86
|
+
"slug": "speciality-chemicals",
|
|
87
|
+
"is_active": true,
|
|
88
|
+
"description": "Procurement of specialty chemicals for various industries.",
|
|
89
|
+
"created_by": 1,
|
|
90
|
+
"updated_by": 1
|
|
82
91
|
}
|
|
83
92
|
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the `ai_models` table. If the table is not empty, all the data it contains will be lost.
|
|
5
|
+
- You are about to drop the `chat_messages` table. If the table is not empty, all the data it contains will be lost.
|
|
6
|
+
- You are about to drop the `chat_threads` table. If the table is not empty, all the data it contains will be lost.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
-- DropForeignKey
|
|
10
|
+
ALTER TABLE "chat_messages" DROP CONSTRAINT "chat_messages_threadId_fkey";
|
|
11
|
+
|
|
12
|
+
-- DropForeignKey
|
|
13
|
+
ALTER TABLE "chat_threads" DROP CONSTRAINT "chat_threads_userId_fkey";
|
|
14
|
+
|
|
15
|
+
-- DropTable
|
|
16
|
+
DROP TABLE "ai_models";
|
|
17
|
+
|
|
18
|
+
-- DropTable
|
|
19
|
+
DROP TABLE "chat_messages";
|
|
20
|
+
|
|
21
|
+
-- DropTable
|
|
22
|
+
DROP TABLE "chat_threads";
|
|
23
|
+
|
|
24
|
+
-- DropEnum
|
|
25
|
+
DROP TYPE "MessageRole";
|
package/prisma/schema.prisma
CHANGED
|
@@ -99,7 +99,6 @@ model User {
|
|
|
99
99
|
activity_logs ActivityLog[]
|
|
100
100
|
contact_us ContactUs[]
|
|
101
101
|
upload_logs UploadLog[]
|
|
102
|
-
chat_thread ChatThread[]
|
|
103
102
|
export_logs ExportLog[]
|
|
104
103
|
department_head Department[] @relation("department_head")
|
|
105
104
|
budget_manager Department[] @relation("budget_manager")
|
|
@@ -2297,62 +2296,6 @@ model UploadLog {
|
|
|
2297
2296
|
|
|
2298
2297
|
//------------------------------------- UPLOAD MODEL END --------------------------------------------
|
|
2299
2298
|
|
|
2300
|
-
//------------------------------------- CHAT THREAD MODEL START --------------------------------------------
|
|
2301
|
-
model ChatThread {
|
|
2302
|
-
id String @id @default(cuid())
|
|
2303
|
-
title String? // Auto-generated or user-defined title
|
|
2304
|
-
userId Int?
|
|
2305
|
-
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
2306
|
-
createdAt DateTime @default(now())
|
|
2307
|
-
updatedAt DateTime @updatedAt
|
|
2308
|
-
isArchived Boolean @default(false)
|
|
2309
|
-
metadata Json? // Store additional context, settings, etc.
|
|
2310
|
-
messages ChatMessage[]
|
|
2311
|
-
|
|
2312
|
-
@@index([userId, createdAt])
|
|
2313
|
-
@@map("chat_threads")
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
//------------------------------------- CHAT THREAD MODEL END --------------------------------------------
|
|
2317
|
-
|
|
2318
|
-
//------------------------------------- CHAT MESSAGE MODEL START --------------------------------------------
|
|
2319
|
-
enum MessageRole {
|
|
2320
|
-
USER
|
|
2321
|
-
ASSISTANT
|
|
2322
|
-
SYSTEM
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
model ChatMessage {
|
|
2326
|
-
id String @id @default(cuid())
|
|
2327
|
-
threadId String?
|
|
2328
|
-
role MessageRole?
|
|
2329
|
-
content String?
|
|
2330
|
-
createdAt DateTime? @default(now())
|
|
2331
|
-
metadata Json? // Store token count, model used, etc.
|
|
2332
|
-
attachments Json? // Store file references, images, etc.
|
|
2333
|
-
thread ChatThread? @relation(fields: [threadId], references: [id], onDelete: Cascade)
|
|
2334
|
-
|
|
2335
|
-
@@index([threadId, createdAt])
|
|
2336
|
-
@@map("chat_messages")
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
//------------------------------------- CHAT MESSAGE MODEL END --------------------------------------------
|
|
2340
|
-
|
|
2341
|
-
//------------------------------------- AI MODEL START --------------------------------------------
|
|
2342
|
-
|
|
2343
|
-
model AIModel {
|
|
2344
|
-
id String @id @default(cuid())
|
|
2345
|
-
name String? @unique
|
|
2346
|
-
provider String? // openai, anthropic, etc.
|
|
2347
|
-
modelName String? // gpt-4, claude-3, etc.
|
|
2348
|
-
isActive Boolean @default(true)
|
|
2349
|
-
config Json? // Store model-specific settings
|
|
2350
|
-
createdAt DateTime @default(now())
|
|
2351
|
-
|
|
2352
|
-
@@map("ai_models")
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
//------------------------------------- AI MODEL END --------------------------------------------
|
|
2356
2299
|
|
|
2357
2300
|
//------------------------------------- USER EVENT CONFIGURATION MODEL END --------------------------------------------
|
|
2358
2301
|
|