Hi experts~
I'm beginner of outsystems.
I made table layout using excel for my app and imported it.
After that, I changed table Keys and field names.
I made very first app and was deploying. but it returned error like this.
"Database Upgrade Error
Could not create / change primary key in 'OSUSR_SL6_ENTITY2' table. Inconsistent database table and entity primary key definitions."
How can I fix this? I cannot find the way to detour this.
Hi Ouk,
It is a common error and happens because of the change of the Primary Key in your data model. Since I've seen this error multiple times (and also the answers in various posts); let me consolidate those solutions (step by step) here.
Database Upgrade Error: Could not create / change primary key in {table-name} table. Inconsistent database table and entity primary key definitions.
OutSystems suggests to "Delete the attribute from your entity definition; or add it in the database table as specified in your eSpace".
What does it mean? How to solve it? - Here are four ways to do it.
Approach 1
ALERT: You will lose the entity data (if any) and the espace version history
Approach 2
ALERT: You will lose the entity data (if any) but the espace version history will be maintained
Approach 3 (recommended)
Approach 4
ALERT: You will lose the entity data (if any). To maintain the data, continue with the optional steps 5 and 6
Regards,
Swatantra
References: Source1, Source2
Approach 2 worked for me like a charm! Thanksss
you cannot change the primary key of your table.
You need to drop that table and create it again with the correct name.
Thanks,
Manish Jawla
The way that i came accross the above issue:
1. Go to service center2. Find your module and click on the link you will be able to see the history of your module.
3. keep your module open in the service studio which you are going to delete in next step.
4. Delete the module
5. Publish the module which is open in the service studio.
this would solve your problem.