Is it possible to verify that a user is over 18 before adding them to the database? While I know this can be done at runtime on REST endpoints, I'm looking for a more secure approach. Is there a way to include a raw SQL check in my database migrations?
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
name String @unique @db.VarChar(40)
email String @unique @db.VarChar(120)
age Int // Check if user's age is above 18 here
}