Running db pull removes name from @@id
See original GitHub issueBug description
Similar old issue I found: https://github.com/prisma/prisma/issues/9318 This time, the name of the id gets lost on db pull
Expected Result:
@@id([userId, companyId], name: "id")
Actual Result:
@@id([userId, companyId])
How to reproduce
- Create a schema and add @@id with a specific name
- Push all changes to db with
prisma db push
- Run
prisma db pull
Expected behavior
The name should be retained:
@@id([userId, companyId], name: "id")
Prisma information
model User {
userId Int @default(autoincrement()) @map("id")
companyId Int
@@id([userId, companyId], name: "id")
}
Environment & setup
- OS: Windows 11
- Database: MariaDB
- Node.js version: 16.15.1
Prisma Version
prisma : 4.1.1
@prisma/client : 4.1.1
Current platform : windows
Query Engine (Node-API) : libquery-engine 8d8414deb360336e4698a65aa45a1fbaf1ce13d8 (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine : migration-engine-cli 8d8414deb360336e4698a65aa45a1fbaf1ce13d8 (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core 8d8414deb360336e4698a65aa45a1fbaf1ce13d8 (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary : prisma-fmt 8d8414deb360336e4698a65aa45a1fbaf1ce13d8 (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : 8d8414deb360336e4698a65aa45a1fbaf1ce13d8
Studio : 0.469.0
Preview Features : interactiveTransactions
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
db pull removes comments inside schema file #9583 - GitHub
After running npx prisma db pull on my schema the comments are removed which is undesirable. Related to prisma/templates#49 ...
Read more >Prisma CLI Command Reference
Prisma is a modern DB toolkit to query, migrate and model your database ... Run prisma db pull to turn your database schema...
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >Prisma Schema not updating properly after adding new fields
Ok so I tried running prisma generate and it worked after restarting my local server of course. Seems I just had to read...
Read more >SQL Performance Best Practices | CockroachDB Docs
The TRUNCATE statement removes all rows from a table by dropping the table and recreating a new table with the same name. This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in commit: https://github.com/prisma/prisma-engines/commit/bffd935029e462592819b33a080e8f8953b58acb
Should be fixed in Prisma version 4.6.0.
Sorry for the long delay to respond. I confirmed that the following schema file is enough to reproduce the issue on a brand new project: