Describe the bug
I have introspected a Django PostgreSQL database with Prisma and the datamodel.prisma file that has been generated cannot be deployed because all the @relation names have been generated with underscores _ which makes them invalid.
Shouldn't the introspect command generate valid @relation names?
Any workaround for this?


@serranoarevalo
Which version of cli are you using?
We recently fixed many of the introspection issues in #4031 so please upgrade to version 1.27 and try again.
If this still an issue please provide a dump of the database which you are using.
@pantharshit00
Hi! I updated and now there are even more and different errors.
You want to see some sample data from the DB or the datamodel.prisma generated by the command?
@serranoarevalo Please share
Also cc @ejoebstl
@pantharshit00 which one?
Both sql dump and the new generated datamodel.
@serranoarevalo
Just noticed that introspection improvements were merged into beta for now.
Can you please try npm i -g prism@beta and try again?
I updated to prisma@beta and I still have errors, you can find the requested files below:
Datamodel: https://gist.github.com/serranoarevalo/cbb63a2ea0726e7f46c47431ff429da4
Errors on deploy: https://gist.github.com/serranoarevalo/9c8a1b2cc65999b9367f8c927691faa1
Dump: https://gist.github.com/serranoarevalo/40c24f32920ef9ce01470aaffe85d98d
@pantharshit00
@serranoarevalo
Looks like the generate name is exceeding the character limit.
This will require a fix.
Hello,
thanks for the files @serranoarevalo, very helpful. I was able to reproduce the issue.
It seems like the CLI is printing an unnormalized datamodel. The duplicate fields and relations names which cause issues here should not even be part of the result.
Does this introspection result look better?
I've pushed a fix here.
That eliminates most problems with the current stable server (1.27). The remaining issue right now is that integer IDs are not support.
Thanks a lot for looking into this!
Any ETA for this?
I had raised the same issue before, I hope this fixed soon.
The fix has landed in the stable version.
Please open a new issue if you are still facing this