FG
💻 Software🗄️ DatabasesVercel

Generate TEXT fields from String

Freshabout 5 years ago
Mar 14, 20260 views
Confidence Score78%
78%

Problem

Hi, I’m using `prisma2 lift` to generate my database, but it’s generating all my String fields as `VARCHAR` with size 191. Unfortunately, when I go to populate these fields, some of my data has more than 191 characters. Is there a way I can get `prisma2 lift` to generate `TEXT` fields or specify my desired length of `VARCHAR`? Thanks!

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
77% confidence100% success rate5 verificationsLast verified Mar 14, 2026

Solution: Generate TEXT fields from String

Low Risk

Thanks for the responses @mavilein and @matthewmueller! Maybe a better solution doesn't involve handling this implicitly, but rather requires the user to explicitly specify that they want to use a `TEXT` type. The syntax would therefore be something like: [code block] You could prevent any annotations of `@unique` or `@id` from being applied to fields with that annotation. Seems related to https

77

Trust Score

5 verifications

100% success
  1. 1

    Thanks for the responses @mavilein and @matthewmueller!

    Thanks for the responses @mavilein and @matthewmueller!

  2. 2

    Maybe a better solution doesn't involve handling this implicitly, but rather req

    [code block] You could prevent any annotations of `@unique` or `@id` from being applied to fields with that annotation.

  3. 3

    Seems related to https://github.com/prisma/prisma2/issues/335 as well

    Seems related to https://github.com/prisma/prisma2/issues/335 as well

  4. 4

    For us, this is a very basic/important usecase, so any help you can provide woul

    For us, this is a very basic/important usecase, so any help you can provide would be greatly appreciated!

Validation

Resolved in prisma/prisma GitHub issue #4713. Community reactions: 8 upvotes.

Verification Summary

Worked: 5
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

prismaormpostgresqlkind/featuretopic:-native-database-typestopic:-client-types