Same database view in different environments generates different cdt

Certified Senior Developer

I have a View in the Appian Cloud database with a column that concatenates some values, lets call it column "CODES".

I started in our dev environments creating a CDT from Table/View and verifying the datastore.

I then did a distribution to the test environment of the CDT, View and Datastore. While verifying in test environment I get an error that CODES is not a MEDIUMTEXT, it's a LONGTEXT. Not knowing what to do I try to create the CDT in test environment and actually the generated CDT in this environment is different that the one that was generated in dev, even though the database view is the same.

Any suggestions on how to solve this issue? The thing is that I don't know in a production environment which datatype Appian will choose, and I don't want to create objects manually in production, I shouldn't even be able to.

Thank you!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Sorry everyone for not replying but my account is being flagged for spam at each comment i make. I'm afraid of being banned so I will just add this.

    These are the XSD of the two environments in order

    <xsd:element name="abi" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="ABI", columnDefinition="LONGTEXT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    <xsd:element name="abi" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="ABI", columnDefinition="LONGTEXT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    In one case I can validate the Data Store without error, in the other case 

    found [mediumtext (Types#LONGVARCHAR)], but expecting [longtext (Types#VARCHAR)] (APNX-2-4056-000)

    But I have know noticed that even with this error in the Data Store, the query entity on this View works, so I won't touch it anymore and hope that in production environment it works.

    I have tried dropping the view and recreating it, deleting the xsd and importing again, it's not changing.

  • 0
    Certified Lead Developer
    in reply to Chiara Gambone
    Sorry everyone for not replying but my account is being flagged for spam at each comment i make. I'm afraid of being banned

    Just to let you know, this is an issue with the software here that happens even to us more experienced users, and the admins are aware of it and, at the very least, manually verify things on their end when they can.  Spambots are a major issue here intermittently which is why the settings are so sensitive (AFAIK), but they won't ban anyone who isn't actually a spambot, regardless of whether you trip the automated flags often or not.

  • 0
    Certified Lead Developer
    in reply to Chiara Gambone

    Why not just update the database column to longtext or the XSD to use mediumtext?

  • 0
    Certified Senior Developer
    in reply to Mathieu Drouin

    Putting the XSD to mediumtext moves the issue from one environment to the other, when I change it it stops verifying in Test and works in Dev.

    As to setting the column to longtext, how do i do it for a database view? I had searched on the web but hadn't find a way to define the type

  • 0
    Certified Lead Developer
    in reply to Chiara Gambone

    You have to do it on the underlying table (the one that the view uses).

    Speaking of which, I see that you posted the structure for the view, but could you check the structure of the underlying table?