table `tenderentry` does not exist in the current database: table names case problem
See original GitHub issueBug description
I use @prisma/client on it’s own, in my applications, like an ORM, with my own migration system and all other stuff. Till 2.26.0 everything was fine. On 2.28.0 (skipped 2.27.0) all was broken: client now tries to query tables named in lowercase, not in case like models are named. E.g. :
model TenderEntry {
id String @id @default(cuid())
}
previously requests like prisma.tenderEntry.findFirst()
queried table name TenderEntry
, now — tenderentry
.
If this is a bug (what I hope it is) — please fix asap.
If not — it is a HUGE breaking change that must be only in major version (besides WHY change this??) and there is even nothing about this in changelogs! You’ve broke all old apps at once or locked them to old client version without possibilty to upgrade client without rewriting migrations and changing tables!
How to reproduce
create any studly cased model, e.g.:
model TenderEntry {
id String @id @default(cuid())
}
and a table:
CREATE TABLE `TenderEntry` (
`id` varchar(25) NOT NULL,
PRIMARY KEY (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
run any query (e.g. prisma.tenderEntry.findFirst()
) and see “table tenderentry
does not exist in the current database”
Expected behavior
query should run over TenderEntry
table
Prisma information
@prisma/client@2.28.0
Environment & setup
- OS: Mac OS
- Database: MySQL
- Node.js version: v14.13.1
Prisma Version
n/a
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
That makes me happy any confused at the same time.
I’ll close this for now then, but as soon as you see something like this again (or anyone else!) please comment here again and we will reopen and happily investigate. Weiiiiird.
@janpio the most weird thing that I’ve rolled back, after new install 2.29.0 kicked in, and with it everything worked fine. set resolution to 2.27.0 — works set resolution to 2.28.0 — works
Tried different combos and variants — no luck to reproduce.
Maybe this was a heisenbug during client generation that time… Strange 😦