Prisma.io
QuickstartDocsFAQCommunityBlogGitHub
QuickstartDocsFAQCommunityBlogGitHub
Getting StartedConceptsGuidesReferenceSupportAbout
Prisma 1 Docs   
Docs
    • Guides
      • Database
        • Developing with Prisma Migrate
        • Seeding your database
        • Schema prototyping with db push
        • Patching / hotfixing
        • Migration troubleshooting
        • Advanced database tasks
      • Performance and optimization
        • Query optimization
        • Transactions
        • Connection management
      • Testing
        • Unit testing
        • Integration testing
      • Deployment
        • Deployment overview
        • Deployment guides
        • Deploying database changes
      • Upgrade Guides
        • Upgrade from Prisma 1
        • Upgrade from Graphcool
      • Migrate to Prisma
        • Migrate from TypeORM
        • Migrate from Sequelize
      • General guides
        • Database workflows
          • Unique constraints
            • Unique constraints and indexes (PostgreSQL)
            • Unique constraints and indexes (MySQL)
            • Unique constraints and indexes (SQLite)
          • Foreign keys
Guides / General guides / Database workflows

Unique constraints

Overview

A unique constraint is a rule that ensures that all values in a column are different. For example, it is likely that you want user IDs and email addresses to be unique within a table.

This section describes how to configure unique constraints for different databases, and the effect of these constraints on the Prisma schema and generated client.

unique constraint illustration

In this section

  • Unique constraints and indexes (PostgreSQL)
  • Unique constraints and indexes (MySQL)
  • Unique constraints and indexes (SQLite)

Was this helpful?

Edit this page on GitHub
Prisma Logo

Products

Prisma ClientPrisma MigratePrisma StudioPrisma 1 CloudProduct Roadmap

Resources

DocsGet StartedAPI ReferenceExamplesHow to GraphQLData Guide

Prisma With

Prisma with Next.jsPrisma with GraphQLPrisma with ApolloPrisma with NestJSPrisma with ExpressPrisma with hapi

Community

Meet the CommunitySlackGitHubDiscussionsGraphQL MeetupTypeScript MeetupAdvanced TypeScript Trickery

Company

AboutJobs We're hiring!CausesBlogTerms & PrivacyHTML Sitemap

Newsletter

Stay up to date with the latest features and changes to Prisma

Find Us

Find us on TwitterFind us on YouTubeJoin us on SlackFind us on GitHub

Prisma © 2018-2021.

Made with ❤️ in Berlin and worldwide