Hi everyone, I'm using Prisma 1.34. When I run `pr...
# orm-help
b
Hi everyone, I'm using Prisma 1.34. When I run
prisma deploy
, it works well. But then, I run
prisma deploy --no-migrate
, an error shows up, I can't figure out the problem, I hope you can. Here is the error and my schema. What should I do with the
language
column ? Its type is text in PostgreSQL.
Copy code
CategoryContent
    ✖ The underlying column for the field `language` has an incompatible type. The field has type `Enum` and the column has type `String`.
Copy code
type CategoryContent @db(name: "category_content") {
  id: Int!
    @id(strategy: SEQUENCE)
    @sequence(
      name: "category_content_id_seq"
      initialValue: 1
      allocationSize: 100
    )
  language: LanguageCode!
  name: String!
}
enum LanguageCode {
  VI
  KO
  EN
}
v
My guess is that you need to have
ENUM
column type as well
b
I don't think so. Prisma will create a
TEXT
column in database if you define a
ENUM
field in schema.
and as I said, I run
prisma deploy
then run
prisma deploy --no-migrate
, if I have to create a
ENUM
column,
prisma deploy
will do it for me.
a
@bkstorm maybe try and run introspect to get the generated datamodel, then apply
b
prisma introspect
generates datamodel exactly like my datamodel.
d
hey @bkstorm 1 year later lol, i’m running into the exact same issue, and did a quick search in the prisma channel and found this. did you figure out how to fix this or did you just change the enums to strings to match the DB?
b
Sorry, I don’t remember how I fixed it, and I don’t use Prisma 1 anymore 😄