Prisma1: Invalid enum - if it starts with lower case

Created on 18 Sep 2018  ·  5Comments  ·  Source: prisma/prisma1

Describe the bug
Prisma server 1.17-beta rejects enum starting with lower case sometimes.

To Reproduce
Steps to reproduce the behavior:
Please follow:-
https://github.com/divyenduz/prisma-3128

Expected behavior
All enums are valid. Lower case enums should be accepted.

Screenshots
screen shot 2018-09-18 at 2 56 09 pm

Versions (please complete the following information):

  • OS: OS X High Sierra
  • prisma CLI: prisma/1.17.0-beta.12 (darwin-x64) node-v10.4.0
  • Prisma Server: prisma:1.17-beta

Additional context
Happened while generating schemas for test cases of
https://github.com/prisma/prisma/tree/beta/cli/packages/prisma-generate-schema

aredocs

All 5 comments

The datamodel in your repository is invalid. Actually, it is a valid Prisma _schema_, but not a valid Prisma _datamodel_.

For example, it contains this input type:

input BillingInfoWithoutConnectionCreateInput {
  account: String!
}

Nevertheless, I can confirm that this error message is returned for this datamodel:

type A {
  id: ID! @unique
  string: String!
}

enum MyEnum {
  someValue
  Value
}
Deploying service `invalid-enum` to stage `dev` to server `local` 57ms

Errors:

  MyEnum
    ✖ The enum type `MyEnum` contains invalid enum values. The first character of each value must be an uppercase letter.

This seems to be the behaviour at least for the last 10 months, see https://github.com/prisma/prisma/blob/a08fa68d3181d05d7732b6e78dadf155306b26f2/server/servers/deploy/src/main/scala/com/prisma/deploy/migration/validation/DeployResults.scala#L189.

It seems to be the currently expected behaviour to enforce capital enum values. This should be added to the documentation here.

Feel free to close this issue, or turn it into a feature request.

I created this feature request: https://github.com/prisma/prisma/issues/3155

I suggest that we update the docs to the current state.

This is already documented here:

image

amazing didn't see that before. Thanks @nikolasburk 🙏

Reopening this with the new MySQL introspection feature - We have some country code enum values which are iso codes (such as fr or en) therefore the model created by prisma introspect fails to prisma deploy, how should we handle this?

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marktani picture marktani  ·  3Comments

AlessandroAnnini picture AlessandroAnnini  ·  3Comments

nikolasburk picture nikolasburk  ·  3Comments

ragnorc picture ragnorc  ·  3Comments

akoenig picture akoenig  ·  3Comments