Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Cristiano Guadagnino
1853
Views
4
Comments
How to solve the "Could not create / change primary key in <table> table."
Question
Hi all,
I am a newbie here at OutSystems.
I had to change the primary key of a table in my model, but now I cannot publish anymore because of this error:
Could not create / change primary key in <table> table. Inconsistent database table and entity primary key definitions
How do I solve it?
Note that:
- The db does not contain any data yet
- I already ensured that the new primary key cannot contain duplicate entries by using an index
- I rebuilt all the relations
But I still have the error.
The help page says: Delete the attribute from your entity definition; or add it in the database table as specified in your eSpace
I do not want (obviously) to delete the attribute from my definition, but I cannot see how to add it to the database table. I don't see anywhere a way to directly see or edit what's in the database. Should I use DDL statements?
Thank you in advance...
Cris
J.
MVP
delete the espace via servicecenter (while keeping it open in your service studio)
then publish it again.
this will remove your whole datamodel and such, so you can start with a clean sheet.
otherwise you will have to do a 3-stage deployment.
introduce the new key first.
publish
copy values from old key to new key.
make it persistent/publish
swap the pk
publish.
remove the old column.
done.
add the column first, publish it.
2 replies
Last reply 18 Apr 2018
Show thread
Hide thread
André Siébra
J.
wrote:
delete the espace via servicecenter (while keeping it open in your service studio)
then publish it again.
this will remove your whole datamodel and such, so you can start with a clean sheet.
otherwise you will have to do a 3-stage deployment.
introduce the new key first.
publish
copy values from old key to new key.
make it persistent/publish
swap the pk
publish.
remove the old column.
done.
add the column first, publish it.
I will not lose my version history of the espace if I do this? If so, instead of delete the espace, you can recreate the entity (just cut and paste the entity in SS and publish). This will cause data loss, as well as delete the espace, but it will keep the version history of my previous publications. If you not want lose your data, the 3-stage deployment is the right choice.
Aditya Chopra
André Siébra
wrote:
J.
wrote:
delete the espace via servicecenter (while keeping it open in your service studio)
then publish it again.
this will remove your whole datamodel and such, so you can start with a clean sheet.
otherwise you will have to do a 3-stage deployment.
introduce the new key first.
publish
copy values from old key to new key.
make it persistent/publish
swap the pk
publish.
remove the old column.
done.
add the column first, publish it.
I will not lose my version history of the espace if I do this? If so, instead of delete the espace, you can recreate the entity (just cut and paste the entity in SS and publish). This will cause data loss, as well as delete the espace, but it will keep the version history of my previous publications. If you not want lose your data, the 3-stage deployment is the right choice.
Thank you so much! :)
Cristiano Guadagnino
Thank you J and André, I will try your suggestions!
I do not have the problem of losing data since there is no data in the db presently, so I'll probably start with André's suggestion.
Cris
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...