-
-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
Description and expected behavior
expected behavior: migrations work without adding a generator to the zmodel shema
actual behavior: migrations do not work when views exist in the zmodel schema unless a generator is added
When running migrate with views i get the following error
✔ Generating TypeScript schema
Generation completed successfully in 242ms.
You can now create a ZenStack client with it.
Check documentation: https://zenstack.dev/docs/
Environment variables loaded from .env
Prisma schema loaded from db/zenstack/~schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "<omitted>" at "<omitted>"
Error: Prisma schema validation - (validate wasm)
Error code: P1012
error: Error validating: View definitions are only available with the `views` preview feature.
--> db/zenstack/~schema.prisma:498
adding this to the zmodel schema fixes the error:
generator client {
provider = ''
previewFeatures = ['views']
}
however, it creates a warning:
"generator" is not used by ZenStack and should be removed.
Environment:
- ZenStack version: [3.3.2]
- Database type: [Postgresql]
- Node.js/Bun version: [24.12.0]
- Package manager: [bun]
Additional context
Not sure if related but i am using multiple postgres schemas (@@schema("schema_name")) across my models/views/enums/etc:
datasource db {
provider = 'postgresql'
url = env('DATABASE_URL')
defaultSchema = 'public'
schemas = [...]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels