Query around Primary Key in Appian My SQL Database

Hi All,

 

I am working on version 18.1.

 

I have a few queries around Primary Key in Appian's MY SQL database:

 

1. In my MySQL database, if I want to create two columns as primary key i.e. if I want to create a composite key rather than making just one column as a primary key then how can I do that as in my data type Appian allows to create only one column as primary key though in XSD we can add two columns as primary key using @Id annotation. So I would like to know how can I achieve this or I can only create one column as primary key.

2. Also would like to know in which scenario do I get Unique Key Constraint violated error.

 

Thanks in advance!!

  Discussion posts and replies are publicly visible

Parents
  • Hi komalc,

    The constraints occur in the following cases:
    Databases can enforce constraints on column values that are not enforced by Appian on CDT field values.

    For example, a database may require a column value to be "not null", but the field in Appian can be empty. Be aware of these differences when designing your data stores.

    Use the attribute nillable="true" to prevent columns in your data store from enforcing a "non-null" constraint.


    You can create additional column to save combination values of (Value 1) and (value 2) Make that additional column as PK in your CDT.
    From DB side Additional Column should be Unique Key, PK is (value 1 and value 2)

    For more info , please have a look on docs.appian.com/.../Database_Schema_Best_Practices.html

    Thanks,
    ravalik
  • 0
    A Score Level 1
    in reply to ravalik
    Hi

    I am aware of the design practice!!
    But I am asking this question out of curiosity as I feel this is a limitation that we can have only one column as primary key in CDT be it an additional column which is a combination of two columns or a column in itself.

    Also any idea about in which scenario do I get "Unique Key Constraint violated error".
Reply Children
No Data