Set long string in Prisma using MySQL

July 16, 2024

In Prisma the string types by default is varchar(191), this means that only can have 191 characters.

Using the type attribute @db, you can modify the length of the text string.

model Model {
  /* ... */
  text        String    @db.Text
  tinyText    String    @db.TinyText
  mediumText  String    @db.MediumText
  longText    String    @db.LongText
}

Read more about Prisma MySQL string .