@campus-labs/prisma-client 0.18.2 → 0.19.1

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": "@campus-labs/prisma-client",
3
- "version": "0.18.2",
3
+ "version": "0.19.1",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -196,6 +196,8 @@ model programs {
196
196
  id Int @id @default(autoincrement())
197
197
  title String @db.VarChar(100)
198
198
  description String @db.VarChar(1000)
199
+ objectives String? @db.VarChar(500)
200
+ vision String? @db.VarChar(500)
199
201
  img Json
200
202
  is_draft Boolean @default(true)
201
203
  is_approved Boolean @default(false)
@@ -663,6 +665,7 @@ model initiatives_tags {
663
665
  @@index([tag_id], map: "idx_initiatives_tags_tag")
664
666
  }
665
667
 
668
+
666
669
  model projects {
667
670
  id Int @id @default(autoincrement())
668
671
  is_draft Boolean @default(true)
@@ -676,14 +679,16 @@ model projects {
676
679
  version Int @default(1)
677
680
  current_state Json
678
681
  repository_ai_badges Json[]
682
+ active_thread_id Int?
679
683
  head_patch_id Int? @unique
680
684
  initiatives initiatives[]
681
685
  patches patches[]
682
-
686
+ snapshots snapshots[]
687
+ chats chats[]
683
688
  authors users @relation("ProjectAuthor", fields: [author_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
684
689
  editors users? @relation("ProjectEditor", fields: [editor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
685
- snapshots snapshots[]
686
- head_patch patches? @relation("ProjectHead", fields: [head_patch_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
690
+ head_patch patches? @relation("ProjectHead", fields: [head_patch_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
691
+ active_thread threads? @relation("ProjectActiveThread", fields: [active_thread_id], references: [id], onDelete: SetNull)
687
692
 
688
693
  @@index([author_id], map: "idx_projects_author")
689
694
  @@index([editor_id], map: "idx_projects_designer")
@@ -719,4 +724,58 @@ model users_ai_requests {
719
724
  users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
720
725
 
721
726
  @@index([user_id], map: "idx_users_ai_requests_user")
727
+ }
728
+
729
+
730
+ model chats {
731
+ id Int @id @default(autoincrement())
732
+ project_id Int
733
+ is_current Boolean @default(true)
734
+ created_at DateTime @default(now()) @db.Timestamp(6)
735
+ updated_at DateTime @default(now()) @db.Timestamp(6)
736
+
737
+ project projects @relation(fields: [project_id], references: [id], onDelete: Cascade)
738
+ threads threads[]
739
+
740
+ @@index([project_id], map: "idx_chats_project")
741
+ }
742
+
743
+ model threads {
744
+ id Int @id @default(autoincrement())
745
+ chat_id Int
746
+ status String @default("ACTIVE") @db.VarChar(20)
747
+ created_at DateTime @default(now()) @db.Timestamp(6)
748
+ updated_at DateTime @default(now()) @db.Timestamp(6)
749
+
750
+ chat chats @relation(fields: [chat_id], references: [id], onDelete: Cascade)
751
+ active_for_projects projects[] @relation("ProjectActiveThread")
752
+ ai_patches ai_patches[]
753
+ conversations ai_conversations[]
754
+
755
+ @@index([chat_id], map: "idx_threads_chat")
756
+ }
757
+
758
+ model ai_conversations {
759
+ id Int @id @default(autoincrement())
760
+ thread_id Int
761
+ prompt String @db.Text
762
+ response String @db.Text
763
+ created_at DateTime @default(now()) @db.Timestamp(6)
764
+
765
+ thread threads @relation(fields: [thread_id], references: [id], onDelete: Cascade)
766
+
767
+ @@index([thread_id], map: "idx_conversations_thread")
768
+ }
769
+
770
+ model ai_patches {
771
+ id Int @id @default(autoincrement())
772
+ thread_id Int
773
+ forward_ops Json[]
774
+ reverse_ops Json[]
775
+ prompt String @db.Text
776
+ created_at DateTime @default(now()) @db.Timestamp(6)
777
+
778
+ thread threads @relation(fields: [thread_id], references: [id], onDelete: Cascade)
779
+
780
+ @@index([thread_id], map: "idx_ai_patches_thread")
722
781
  }