Standards, best practices and how-tos for developing OutSystems applications
When you make changes to the Data Model this may impact modules in all environments of your factory an can potentially raise blocking deployment issues. The OutSystems reference is describes how Data Model changes are handled.
This article describes how to manage data model changes in your factory and when distributing your application (Forge component or ISV delivery) for the following use cases:
The attribute remains in the database until you drop the attribute from the database. To do this there are several methods available depending on your installation and permissions.
If you have database access you can use database management tools to drop columns. Be aware that once a column is dropped it’s no longer save to revert to a version where that column exists and the data in the column is lost. Access the database of your OutSystems Cloud describes how to get access to the SaaS database.
:warning:WARNING! Only to be used by experienced staff who understands the impact.
You can use the DBCleaner_API to manage your database. OutSystems recommends the use of the DB Cleaner on Steroids forge component.
Please refer to DB Cleaner on Steroids Documentation to understand the impact of using this component.
:exclamation:DISCLAIMER This component is provided AS-IS with no warranty and is not supported by OutSystems. This component takes advantage of private and undocumented Platform APIs, which can change without notice. As a result, this component may unexpectedly break as the Platform is upgraded.
We advise proper testing to ensure that your applications continue to work as expected when upgrading/patching the Platform.
Do not use this component in Production unless proper testing and certainty of the operations and its impacts on the data that exists in the environment.
Beware of the reuse of deleted attributes that still exists as columns in the database. New attributes are always added as new columns at the end of the table. The order in Service Studio has no effect.
Try to avoid renaming an attribute, change the label instead. If a rename is necessary after you deployed to another environment use the following steps:
First check if the type conversion is supported. If it is possible proceed with changing the datatype else follow the procedure described in Renaming an Attribute
When there is data present you must ensure the uniqueness before adding the index otherwise the deploy will fail.
When you make a foreign key mandatory a NOT NULL is added to the column. If there are already columns with null values the deploy will fail. To proceed do the following:
If you make an attribute mandatory that is not a foreign key no check is made in the database thus empty values are allowed. You must add validation logic to ensure that the field is not empty in both the crud wrappers as in the front end validations.