Entity, Attribute

Entity, Attribute

  



scenario #1: John Smith (developer) decided to built an application (Product Y) using outsystems platform, the application uses many entity database tables.

John completes the application and decides to release "product Y" version 1.0, since it's release it has been used by X number of user's (hence the database now contain live data).

A few months later, John decides to upgrade the application, adding new features, fixing bugs etc These changes require John to make modification to the database table (entity), in this case to an existing database table.
Example:

In Product Y v1.0, contains the following entity and attributes

"FRUIT"

-Name

In Product Y v2.0, the developer updates the application with additional features and adds 3 new attribute

"FRUIT"

-Name

-TypeID

-GradeID

-SupplierID


The question is,......
1 - what happens to the user's data? will it be affected along with these changes? (ie will outsystem wipe the user's data clean?)
2 - what about If John decides to rename an existing entity or attribute name, that contains live data, what will happen to the user's data? in this case.

Note: in reality a scenario such as the one described above is most likely to occur, application changes all the time and sometime, at a very RAPID rate, and we need to be able to handle these changes, without causing delay or lost in revenue for the business.
Hello robert,


Don't worry about losing data. If you add an attribute, the table in the database is altered to contain this attribute, all user-data remains unchanged.

Same goes for renaming attributes.

However, if you change an attributes type, and the new type can not contain the old type's data, some data might be lost.

Hans
thanks
Hello,

I'm under the impression that when you rename an entity or attribute, the platform will create a new table or column with the new name. You won't loose your data, as the table or column will be kept in the database, but you'll have to copy your old records to the new table or column.

FS

Indeed data is never lost.

 

Even if you change an Attribute data type, the convertion is only done by the platform if possible. Otherwise, publication will not be allowed and you must either convert data using the database client tools, or simply create a new attribute with the desired data type and do some logic to perform the convertion in your app.

 

Regarding entities, you can rename them at will and they will still map to the original database table. As for attributes, if you rename them, the platform will create a new attribute in the database table and leave the old one untoutched with all its data (but dropping any existing integrity contrains).

 

 

Hope this clarifies everything. Cheers,