Data model
In this section
Models
The data model definition part of the Prisma schema defines your application models (also called Prisma models). Models:
Relations
Indexes
Prisma ORM allows configuration of database indexes, unique constraints and primary key constraints. This is in General Availability in versions 4.0.0 and later. You can enable this with the extendedIndexes Preview feature in versions 3.5.0 and later.
Views
Support for views is currently a very early Preview feature. You can add a view to your Prisma schema with the view keyword or introspect the views in your database schema with db pull. You cannot yet apply views in your schema to your database with Prisma Migrate and db push unless the changes are added manually to your migration file using the --create-only flag. For updates on progress with this feature, follow our GitHub issue.
Database mapping
The Prisma schema includes mechanisms that allow you to define names of certain database objects. You can:
How to use Prisma ORM with multiple database schemas
Multiple database schema support is currently available with the PostgreSQL, CockroachDB, and SQL Server connectors.
Unsupported database features
Not all database functions and features of Prisma ORM's supported databases have a Prisma Schema Language equivalent. Refer to the database features matrix for a complete list of supported features.
Table inheritance
Overview