@varaos/db 1.4.3 → 1.4.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varaos/db",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "files": [
@@ -0,0 +1,21 @@
1
+ -- CreateTable
2
+ CREATE TABLE "tool_requests" (
3
+ "id" TEXT NOT NULL,
4
+ "userId" TEXT NOT NULL,
5
+ "catalogId" TEXT NOT NULL,
6
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
7
+
8
+ CONSTRAINT "tool_requests_pkey" PRIMARY KEY ("id")
9
+ );
10
+
11
+ -- CreateIndex
12
+ CREATE UNIQUE INDEX "tool_requests_userId_catalogId_key" ON "tool_requests"("userId", "catalogId");
13
+
14
+ -- CreateIndex
15
+ CREATE INDEX "tool_requests_catalogId_idx" ON "tool_requests"("catalogId");
16
+
17
+ -- AddForeignKey
18
+ ALTER TABLE "tool_requests" ADD CONSTRAINT "tool_requests_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
19
+
20
+ -- AddForeignKey
21
+ ALTER TABLE "tool_requests" ADD CONSTRAINT "tool_requests_catalogId_fkey" FOREIGN KEY ("catalogId") REFERENCES "integration_catalog"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,11 +1,13 @@
1
1
  generator client {
2
2
  provider = "prisma-client-js"
3
+ previewFeatures = ["postgresqlExtensions"]
3
4
  }
4
5
 
5
6
  datasource db {
6
7
  provider = "postgresql"
7
8
  url = env("DATABASE_URL")
8
9
  directUrl = env("DIRECT_URL")
10
+ extensions = [vector]
9
11
  }
10
12
 
11
13
  /// ─────────────────────────────────────────────
@@ -365,6 +367,8 @@ model User {
365
367
  memories Memory[]
366
368
  documents Document[]
367
369
 
370
+ toolRequests ToolRequest[]
371
+
368
372
  @@index([status])
369
373
  }
370
374
 
@@ -585,6 +589,8 @@ model IntegrationCatalog {
585
589
  updatedAt DateTime @updatedAt
586
590
  Integration Integration[]
587
591
 
592
+ toolRequests ToolRequest[]
593
+
588
594
  @@unique([provider, integration])
589
595
  @@index([status])
590
596
  @@map("integration_catalog")
@@ -600,6 +606,24 @@ model IntegrationSyncLog {
600
606
  integration Integration @relation(fields: [integrationId], references: [id])
601
607
  }
602
608
 
609
+ /// ─────────────────────────────────────────────
610
+ /// TOOL REQUESTS (User Upvotes for Upcoming Tools)
611
+ /// ─────────────────────────────────────────────
612
+
613
+ model ToolRequest {
614
+ id String @id @default(uuid())
615
+ userId String
616
+ catalogId String
617
+ createdAt DateTime @default(now())
618
+
619
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
620
+ catalog IntegrationCatalog @relation(fields: [catalogId], references: [id], onDelete: Cascade)
621
+
622
+ @@unique([userId, catalogId])
623
+ @@index([catalogId])
624
+ @@map("tool_requests")
625
+ }
626
+
603
627
  /// ─────────────────────────────────────────────
604
628
  /// AUTOMATIONS / AI / WORKFLOWS
605
629
  /// ─────────────────────────────────────────────