Hey, I have a problem with generated migrations. I...
# orm-help
m
Hey, I have a problem with generated migrations. In them table names are all lowercase ie. chatline but my actual table names are like chatLine and it leads to errors when migrating on production. Actually my model name is ChatLine but there is @@map("chatLine")
r
@Mateusz Żmijewski 👋 Could you share how you have created the migrations? If there’s a
@@map
in your
schema.prisma
then you would always get the correct table name in the database.
m
I used the command npx prisma dev --name NameOfMyMigration
r
Yes that should generate an SQL file where the table name will be the one specified in
@@map
.
m
Yet it looks like this
r
The table names look correct
m
In my schema I have chatline set to chatLine
Hmm, maybe as a workaround I could rename chatLine to chatline in @@map?
r
What database are you using and which version of Prisma are you on?
m
MySQL 8, Prisma 3.3.0 but I was previously on 2.30.0 with the same result
r
Just tried with MySQL 8 and Prisma 3.3.0 with the following schema and I get the correct name:
Copy code
model UserList {
  id   Int    @id @default(autoincrement())
  name String

  @@map("userList")
}
Could you try on a sample model and check?