# Data model changes and their impact levels

Available in...

* Data Fabric
* MDM Platform

The data model changes are classified into three levels according to their impacts on the data model: Low, Medium and High.

When you made changes to a data model, the database schema will be updated accordingly.

Below are some examples of the data model changes, their corresponding impact level, and the results in the database:

| Action | Impact level | Result |
| --- | --- | --- |
| Add a new mandatory element without a default<br>value | High | The entity table is dropped and recreated with<br>the new column added. |
| Add or remove anonymous types | High | All entity types using anonymous types may be<br>dropped and recreated. |
| Change an optional simple type element to a<br>mandatory one without a default value (null<br>values exist for the given element) | High | The entity table is dropped and recreated. |
| Change an optional complex type element to a<br>mandatory one | High | The entity table is dropped and recreated. |
| Change the type of an element from one simple<br>type to another | High | N/A |
| Change the maximum occurrence of an element from<br>1 to n or vice versa | High | The entity table is dropped and recreated. |
| Change the value of totalDigits or fractionDigits<br>of a decimal element | High | The entity table is dropped and recreated. |
| Make changes in inheritance | High | All tables involved in the inheritance tree are<br>dropped and recreated. |
| Make high impact changes to an entity that has<br>foreign key relationships | High | The entity table is dropped and recreated,<br>together with the tables of all other entities that have foreign<br>key relationships with this entity. |
| Remove a mandatory or optional simple type<br>element in a complex type element | High | The entity table is dropped and recreated. |
| Remove a mandatory or optional complex type<br>element | High | The entity table is dropped and recreated. |
| Change an optional simple type element to a<br>mandatory one with a default value (null values exist for the<br>given element) | Medium | The column in the entity table will be updated<br>with the default value. |
| Remove a mandatory or optional simple type<br>element immediately under an entity | Medium | The column in the entity table will be<br>removed. |
| Remove a mandatory or optional foreign key<br>element | Medium | The column in the entity table will be<br>removed. |
| Remove an entity | Medium | The entity table will be removed. |
| Rename an optional element | Medium | A column with the old name remains and a new<br>column with a new name is created. |
| Add a new optional simple type element | Low | A new column is added to the entity table. |
| Add a new optional complex type element | Low | A new column is added to the entity table, and a<br>new table is created for the complex type. |
| Add a new element (of string, boolean or numeric<br>type) with a default value | Low | A new column is added to the entity table with<br>the default value. |
| Change a mandatory simple or complex type<br>element to an optional one | Low | The column definition in the entity table will<br>be changed accordingly. |
| Change an optional simple type element to a<br>mandatory one (no null values exist for the given element) | Low | The column definition in the entity table will<br>be changed accordingly. |
| Change an optional multi-occurrence element to a<br>mandatory multi-occurrence one or vice versa | Low | The column definition in the entity table will<br>be changed accordingly. |
| Increase the length of a string element for<br>DB2/Oracle<br><br>The original length is less than<br>or equal to the maximum length of the database VARCHAR type, and<br>the updated length is greater than the maximum length. ^1^ | High | The entity table is dropped and recreated, the<br>type of the element is converted from VARCHAR to CLOB in the<br>database, and the length of the column is increased<br>accordingly. |
| Increase the length of a string element for MS<br>SQL Server/MySQL/PostgreSQL<br><br>The original length<br>is less than or equal to the maximum length of the database<br>VARCHAR type, and the updated length is greater than the maximum<br>length. ^1^ | Low | The type of the element is converted from<br>VARCHAR to NVARCHAR(MAX)/TEXT/TEXT in the database, and the length<br>of the column is increased accordingly. |
| Increase the length of a string element (except<br>the above two cases) | Low | The length of the column is increased<br>accordingly. |
| Decrease the length of a string element<br><br>The original length is greater than the maximum<br>length of the database VARCHAR type, and the updated length is<br>less than or equal to the maximum length. ^1^ | High | The entity table is dropped and recreated, the<br>type of the element is converted to VARCHAR in the database, and the<br>length of the column is decreased accordingly. |
| Decrease the length of a string element<br><br>Both the original length and the updated length<br>are less than or equal to the maximum length of the database<br>VARCHAR type. ^1^ | High | The entity table is dropped and recreated, and<br>the length of the column is decreased accordingly. |
| Decrease the length of a string element (except<br>the above two cases) | Low | The length of the column is decreased<br>accordingly. |

^1^ The maximum length of the VARCHAR type for each supported database:

| Database | Maximum length of the VARCHAR type<br>(bytes) |
| --- | --- |
| H2 | 255 |
| DB2 | 255 |
| MySQL | 255 |
| MS SQL Server | 4000 |
| Oracle | 4000 |
| PostgreSQL | 255 |