Any reason why the datamodel returned by `prisma i...
# orm-help
b
Any reason why the datamodel returned by
prisma introspect
on an existing postgres db can't be then deployed? Just a limitation of the tool as it currently is?
prisma deploy
says there are lots of small errors with the datamodel file.
n
Can we see you datamodel file?
b
It's pretty massive and I would have to anonymise the field names a bit first, as it's all confidential IP.
Can I give you a smaller sample and the matching errors?
Well, here's the first error:
Copy code
Error: Syntax error while parsing GraphQL query. Invalid input ""collection-owner")\n  object-", expected Argument, FieldDefinition, Directive, Comments or Value (line 944, column 35):
  id: ID! @unique @pgColumn(name: "collection-owner")
Fortunately that table isn't necessary, so I can just omit it entirely. Once that is done, though:
Copy code
Errors:

  Pms_sip_rt
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_blf
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_conference
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_customdial
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_featurecode
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_line
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_paginggroup
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Sip_phone_buttons_speeddial
    ✖ The field `id` is reserved and has to have the format: id: ID! @unique or id: UUID! @unique.

  Users
    ✖ The type `Users` has a duplicate fieldName.
    ✖ The type `Users` has a duplicate fieldName.
    ✖ Invalid value '1999-12-31 11:00:00+00' for type DateTime.

  Call_me_chat_logins
    ✖ Invalid value '1999-12-31 11:00:00+00' for type DateTime.

  Status_settings
    ✖ The field `base` specifies a directive more than once. Directives must appear exactly once on a field.
    ✖ The field `status_settings_bases` specifies a directive more than once. Directives must appear exactly once on a field.
    ✖ The field `status_settings_timer_change_statuses` specifies a directive more than once. Directives must appear exactly once on a field.
    ✖ The field `timer_change_status` specifies a directive more than once. Directives must appear exactly once on a field.
Obviously I can fix these but I want to know if that's expected for a large legacy postgres db that there will be some errors trying to deploy the file produced by
prisma introspection
.
Even when those simple ones are fixed, still, deploy says is declaring a syntax error on any
@pgTable
or
@pgRelation
directive, e.g.
Copy code
Error: Syntax error while parsing GraphQL query. Invalid input ""server_id")\n  user_id: ID! @unique!", expected Value, Argument, Directive or FieldDefinition (line 32, column 48):
Even when those simple ones are fixed, still, deploy says is declaring a syntax error on any
@pgTable
or
@pgRelation
directive, e.g.
Copy code
Error: Syntax error while parsing GraphQL query. Invalid input ""buddy_error_log") {\n  id: ID! @unique\n  datetime: DateTime\n  extension: String!\n  line: Int\n  msg: String\n  parent_url: String!\n  stacktrace: String\n  url: String\n  user_agent: String!\n  user_id: ID! @unique!", expected ValueConst, ArgumentConst, DirectiveConst or FieldDefinitions (line 15, column 37):

Error: Syntax error while parsing GraphQL query. Invalid input ""server_id")\n  user_id: ID! @unique!", expected Value, Argument, Directive or FieldDefinition (line 32, column 48):
@nilan Any thoughts?
n
Hey there. I don't have any thoughts on this at the moment 🙂 But if you share your reproduction example in a new issue, I'll take a look later. https://github.com/prisma/prisma/issues/new?template=bug_report.md