mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix: remove multiSchema - follow existing AutoGPT pattern
Remove unnecessary multiSchema configuration that broke existing models. AutoGPT uses connection string's ?schema=platform parameter as default, not Prisma's multiSchema feature. Existing models (User, AgentGraph, etc.) have no @@schema() directives and work fine. Changes: - Remove schemas = ["platform", "public"] from datasource - Remove "multiSchema" from previewFeatures - Remove all @@schema() directives from LLM models and enum Migration SQL already creates tables in platform schema explicitly (CREATE TABLE "platform"."LlmProvider" etc.) which is correct. This matches the existing pattern used throughout the codebase.
This commit is contained in:
@@ -3,14 +3,13 @@ datasource db {
|
||||
url = env("DATABASE_URL")
|
||||
directUrl = env("DIRECT_URL")
|
||||
extensions = [pgvector(map: "vector")]
|
||||
schemas = ["platform", "public"]
|
||||
}
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-py"
|
||||
recursive_type_depth = -1
|
||||
interface = "asyncio"
|
||||
previewFeatures = ["views", "fullTextSearch", "postgresqlExtensions", "multiSchema"]
|
||||
previewFeatures = ["views", "fullTextSearch", "postgresqlExtensions"]
|
||||
partial_type_generator = "backend/data/partial_types.py"
|
||||
}
|
||||
|
||||
@@ -1343,8 +1342,6 @@ model OAuthRefreshToken {
|
||||
enum LlmCostUnit {
|
||||
RUN
|
||||
TOKENS
|
||||
|
||||
@@schema("platform")
|
||||
}
|
||||
|
||||
model LlmProvider {
|
||||
@@ -1364,7 +1361,6 @@ model LlmProvider {
|
||||
|
||||
Models LlmModel[]
|
||||
|
||||
@@schema("platform")
|
||||
}
|
||||
|
||||
model LlmModel {
|
||||
@@ -1406,7 +1402,6 @@ model LlmModel {
|
||||
@@index([providerId, isEnabled])
|
||||
@@index([creatorId])
|
||||
// Note: slug already has @unique which creates an implicit index
|
||||
@@schema("platform")
|
||||
}
|
||||
|
||||
model LlmModelCost {
|
||||
@@ -1429,7 +1424,6 @@ model LlmModelCost {
|
||||
|
||||
@@unique([llmModelId, credentialProvider, unit])
|
||||
@@index([credentialProvider])
|
||||
@@schema("platform")
|
||||
}
|
||||
|
||||
model LlmModelCreator {
|
||||
@@ -1447,7 +1441,6 @@ model LlmModelCreator {
|
||||
|
||||
Models LlmModel[]
|
||||
|
||||
@@schema("platform")
|
||||
}
|
||||
|
||||
model LlmModelMigration {
|
||||
@@ -1487,5 +1480,4 @@ model LlmModelMigration {
|
||||
@@index([targetModelSlug])
|
||||
@@index([isReverted])
|
||||
@@index([sourceModelSlug, isReverted]) // Composite index for active migration queries
|
||||
@@schema("platform")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user