Skip to main content
Solved

Constraints gone after failure in upgrade


Forum|alt.badge.img+2

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

Best answer by Dennis Kallansee

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

View original
This topic has been closed for comments

Forum|alt.badge.img+2

The references are also still there in Thinkwise
 

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


Mark Jongeling
Administrator
Forum|alt.badge.img+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)


Forum|alt.badge.img+2

Hi Mark,

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

 

Greetings,
Dennis


Mark Jongeling
Administrator
Forum|alt.badge.img+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.


Forum|alt.badge.img+2

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


Mark Jongeling
Administrator
Forum|alt.badge.img+23

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings