Question

Constraints gone after failure in upgrade


Badge +1

Hi,

Recently we did a merge and a full upgrade from one branch to another. Somehow the upgrade failed which resulted into 4 tables being renamed to __table_name__

We renamed them back from __table_name__ to the original table name but we found out that the constraints are missing.

We tried to do a full upgrade again hoping that the constrains would return but they keep missing. How do we get the constraints back?

The correct constraints on DEV

The incorrect constraints on TEST after the upgrade failed and rename of the tables
 

We are missing
DF_entity_data_mut_tenant_guid
DF_entity_data_mut_insert_employee_guid
DF_entity_data_mut_update_employee_guid


6 replies

Badge +1

The references are also still there in Thinkwise
 

So… how do i “force” to recreate the constraints?

Userlevel 7
Badge +23

Hi Dennis,

We tried to do a full upgrade again hoping that the constrains would return but they keep missing. How do we get the constraints back?

Backup restore would be the easiest, or you could opt to do a Full upgrade instead. This will reapply all logic, keys, indexes and constraints.

DF constraints are default values, C are Check constraints. 

how do i “force” to recreate the constraints?

Same as stated above. References are keys in SQL Server, not constraints.

Recommended is to backup your end product before upgrading it. In case of any error, you can easily revert back by restoring the backup. 

Related idea: Upgrade rollback | Thinkwise Community (thinkwisesoftware.com)

Badge +1

Hi Mark,

A full upgrade is not fixing it unfortunately. I don't understand why it's not.

 

Greetings,
Dennis

Userlevel 7
Badge +23

Best thing to do now is going into SF > Data > Data migration and checking the "Rebuild table” checkbox. This will tell the SF to recreate the tables and migrate the data accordingly. That should also rebuild the Default value constraints. Once the affected tables have been checked, run a Creation to deploy it. This will of course take a while longer as all affected tables need to be recreated.

Badge +1

I ended up restoring a backup. Data migration didnt work unfortunately

Userlevel 7
Badge +23

That's unfortunate. I personally never encountered this scenario so I hoped this could solve it. Glad the restore fixed it 😄

Reply