Database Upgrade Error - Column 'OSUSR_YGE_ENDUSER.ID' exists in database

Good day,

When I am publishing the Blank Module I get this error.


(I have uploaded this picture if it is not properly visible here)


Can someone assist me to understand what is the cause of this error.


Regards,

Malebo Sambo

Solution

Hi, 

What is happening is the following:

1. You did create some entities. 

2. You published your module. 

3. You changed the Id of one of the entities, that was autonumber to not be autonumber. 

4. You try to publish, and it fails with that warning. 

In OutSystems, you can't change, or replace, the Identifier, after you published the entity. 

The easiest solution is to create a new entity with the changes to the attribute, and replace the old one by this. 

But this does not work as smoothly if you have data in this entity (in any environment), and you want to keep the data. In this case you can't delete the old, and need to prepare some kind of data migration to be executed after publishing. 

What's exact your needs relative to keep existing data? 

Cheers 



Solution

Hey Eduardo,


Thank you for your response. The existing data is not important because I have a back-up Excel of that data. So I then deleted the existing Entity and created a new one with the changes I need and can now publish successfully.


Can you also assist in helping me understand the "User_GetUnifiedLoginUrl" action. What I want to achieve is that I created a Registration Screen for Annonymous Users to fill in a "Sign Up" form with Inputs "Name, Username and Password" from the User entity. When a user clicks "Save" I want to save the details to the User entity and then automatically log in the user and direct them to a Dashboard Screen using their newly created "UserId". I want that every screen filters using the logged in "UserId".


Regards,

Malebo

Hi,

When you have a question that is not related to your previous one, create a new topic, please :)
This helps to keep the forum easy to search.

1. You don't need that action.

2. You need to hash the password before saving the user in the User entity. You can use the EncriptPassword action from Users API.

3. To log in the user automatically after the registration, use the Login action from System API. It does not require the password, just the user ID.

4. On every aggregate/SQL or anything else, add filters using the User ID. GetUserId() built-in function returns the ID of the logged user Id.

That's it :)

Hope this helps.

Cheers.