Here my current schema, but I'd like to make the attribute the primary key:
<attribute label="aaa" name="aaa" type="string"/>
How to do so?
<srcSchema _cs="DTI_XXX (abc)" created="2024-08-26 19:36:36.581Z" createdBy-id="0"
entitySchema="xtk:srcSchema" img="xtk:schema.png" label="DTI_XXX"
lastModified="2024-09-06 03:50:16.385Z" mappingType="sql" md5="AF12309BC7EC4DD0D7B62A928E490687"
modifiedBy-id="0" name="DTI_XXX" namespace="abc" xtkschema="xtk:srcSchema">
<createdBy _cs="c (cccc)"/>
<modifiedBy _cs="c (cccc)"/>
<element autopk="true" label="DTI_XXX" name="DTI_XXX">
<attribute label="aaa" name="aaa" type="string"/>
</element>
</srcSchema>
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @ogonzalesdiaz ,
To create custom primary key, use the below syntax,
<element label="DTI_XXX" name="DTI_XXX">
<key internal="true" name="customPrimaryKey">
<keyfield xpath="@aaa"/>
</key>
<attribute label="aaa" name="aaa" type="string"/>
</element>
You can remove autopk="true"
Hi @ogonzalesdiaz,
You can make the attribute aaa the primary key by adding primarykey="true". Additionally, you will need to modify the autopk="false", so that it does not automatically generate a primary key.
This will be the following:
<element autopk="false" label="DTI_XXX" name="DTI_XXX">
<attribute label="aaa" name="aaa" type="string" primaryKey= "true"/>
</element>
Regards,
Celia
Views
Replies
Total Likes
Hi @ogonzalesdiaz ,
To create custom primary key, use the below syntax,
<element label="DTI_XXX" name="DTI_XXX">
<key internal="true" name="customPrimaryKey">
<keyfield xpath="@aaa"/>
</key>
<attribute label="aaa" name="aaa" type="string"/>
</element>
You can remove autopk="true"
I think this is the best approache, since it lets you define a combined primary key like this:
Views
Likes
Replies
Views
Likes
Replies