question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prisma generate - The model name `Subscription` is invalid - Can you un-reserve the name `Subscription`?

See original GitHub issue

Subscription is an object we are using, Can you un-reserve the name Subscription? Thanks

npx prisma generate
Environment variables loaded from prisma/.env
Error: Schema parsing
error: Error validating model "Subscription": The model name `Subscription` is invalid. It is a reserved name. Please change it.
  -->  schema.prisma:1158
   | 
1157 | 
1158 | model Subscription {
1159 |   averagePrice           Float?
1160 |   companieId             String
1161 |   countAveragePrice      Float?
1162 |   createdAt              DateTime
1163 |   dateCancellation       DateTime?
1164 |   id                     String                         @id
1165 |   issuedCardId           String
1166 |   lastInvoiceDate        DateTime?
1167 |   maxDateAveragePrice    DateTime?
1168 |   minDateAveragePrice    DateTime?
1169 |   paymentFrequency       Subscription_paymentFrequency?
1170 |   productId              String
1171 |   status                 Subscription_status
1172 |   testMode               Boolean
1173 |   trialPeriod            Float?
1174 |   updatedAt              DateTime
1175 |   userId                 String
1176 |   Companie               Companie                       @relation(fields: [companieId], references: [id])
1177 |   IssuedCard             IssuedCard                     @relation(fields: [issuedCardId], references: [id])
1178 |   Product                Product                        @relation(fields: [productId], references: [id])
1179 |   User                   User                           @relation(fields: [userId], references: [id])
1180 |   SubscriptionInvoice    SubscriptionInvoice[]          @relation("SubscriptionToSubscriptionInvoice_subscriptionId")
1181 |   SubscriptionManagement SubscriptionManagement[]
1182 |   DataProduct            DataProduct[]                  @relation(references: [id])
1183 |   File                   File[]                         @relation(references: [id])
1184 |   Log                    Log[]                          @relation(references: [id])
1185 | 
1186 |   @@index([companieId], name: "companieId")
1187 |   @@index([issuedCardId], name: "issuedCardId")
1188 |   @@index([productId], name: "productId")
1189 |   @@index([userId], name: "userId")
1190 | }
   | 

Validation Error Count: 1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
janpiocommented, Aug 5, 2020

You can change the name of the model to something else than Subscription and add @@map("Subscription") inside the model, so Prisma knows what database table this refers to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message reference - Prisma
Prisma Client throws a PrismaClientInitializationError exception if something goes wrong when the query engine is started and the connection to the database is ......
Read more >
Terms of Use - Prisma Labs
If made via a Google in-app subscription or purchase use the chat bot here to make that request or learn more about refunds...
Read more >
Subscriptions You Can Use With the Firewall
List of available firewall subscriptions.
Read more >
Editorial and publishing policies | Scientific Reports - Nature
We reserve the right to reject a paper even after it has been accepted if it ... You may also name a limited...
Read more >
Terms of Use - Lensa AI
There are additional paid features – for example, you would need to pay us to generate Avatars. To pay for subscription or any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found