@varaos/db 1.1.3 → 1.1.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.1.3",
3
+ "version": "1.1.4",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "files": [
@@ -0,0 +1,21 @@
1
+ -- AlterEnum
2
+ -- This migration adds more than one value to an enum.
3
+ -- With PostgreSQL versions 11 and earlier, this is not possible
4
+ -- in a single migration. This can be worked around by creating
5
+ -- multiple migrations, each migration adding only one value to
6
+ -- the enum.
7
+
8
+
9
+ ALTER TYPE "public"."Status" ADD VALUE 'draft';
10
+ ALTER TYPE "public"."Status" ADD VALUE 'pending_review';
11
+ ALTER TYPE "public"."Status" ADD VALUE 'deprecated';
12
+ ALTER TYPE "public"."Status" ADD VALUE 'archived';
13
+
14
+ -- DropIndex
15
+ DROP INDEX "public"."Workspace_ownerId_key";
16
+
17
+ -- CreateIndex
18
+ CREATE INDEX "AuditLog_userId_createdAt_idx" ON "public"."AuditLog"("userId", "createdAt");
19
+
20
+ -- CreateIndex
21
+ CREATE INDEX "Workspace_ownerId_idx" ON "public"."Workspace"("ownerId");
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "public"."integration_catalog" ALTER COLUMN "status" SET DEFAULT 'draft';
@@ -22,9 +22,13 @@ enum Role {
22
22
  }
23
23
 
24
24
  enum Status {
25
- active
26
- suspended
27
- deleted
25
+ active // Visible and usable in production
26
+ suspended // Temporarily disabled but can be restored
27
+ deleted // Soft-deleted or removed from UI
28
+ draft // Being worked on but not yet published
29
+ pending_review // Awaiting manual or automated approval
30
+ deprecated // Old but still accessible for legacy users
31
+ archived // Hidden from new users, preserved for history
28
32
  }
29
33
 
30
34
  enum Plan {
@@ -134,7 +138,7 @@ model Workspace {
134
138
  id String @id @default(uuid())
135
139
  name String
136
140
  description String?
137
- ownerId String @unique
141
+ ownerId String
138
142
  status Status @default(active)
139
143
  deletedAt DateTime?
140
144
 
@@ -150,6 +154,7 @@ model Workspace {
150
154
  ChatSession ChatSession[]
151
155
 
152
156
  @@index([status])
157
+ @@index([ownerId])
153
158
  }
154
159
 
155
160
  model Integration {
@@ -195,7 +200,7 @@ model IntegrationCatalog {
195
200
  docsUrl String?
196
201
  oauthType String?
197
202
  setupInstructions Json?
198
- status Status @default(active)
203
+ status Status @default(draft)
199
204
 
200
205
  createdAt DateTime @default(now())
201
206
  updatedAt DateTime @updatedAt
@@ -490,6 +495,8 @@ model AuditLog {
490
495
  createdAt DateTime @default(now())
491
496
 
492
497
  user User? @relation(fields: [userId], references: [id])
498
+
499
+ @@index([userId, createdAt])
493
500
  }
494
501
 
495
502
  /// ─────────────────────────────────────────────