How to solve the "Could not create / change primary key in <table> table." error

How to solve the "Could not create / change primary key in <table> table." error

  
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
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.

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 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