Insight was mistakenly upgraded past version 8.4 without running the steps at https://confluence.atlassian.com/insightapps/preparing-for-insight-8-4-1085180929.html.
Subsequently, the instructions under section "
What if I upgraded to 8.4.X without executing the Database changes by accident?" at
https://confluence.atlassian.com/insightapps/insight-8-4-faqs-1085180949.html were followed. The section's first instruction is to uninstall Insight. This was done and the first SQL query was run agains MySQL 5.7
ALTER TABLE AO_8542F1_IFJ_OBJ_ATTR_VAL DROP CONSTRAINT fk_ao_8542f1_ifj_obj_attr_val_object_attribute_id;
Then the next command was run (it says postgres syntax but it worked for mysql, apparently)
UPDATE propertystring SET propertyvalue = '75' WHERE id = ( SELECT id FROM propertyentry WHERE property_key = 'com.riadalabs.jira.plugins.insight:build');
I then installed the latest version of Insight by uploading it (could not install it thought the marketplace)
Finally, ran the command
ALTER TABLE AO_8542F1_IFJ_OBJ_ATTR_VAL ADD CONSTRAINT fk_ao_8542f1_ifj_obj_attr_val_object_attribute_id
FOREIGN KEY (OBJECT_ATTRIBUTE_ID) REFERENCES AO_8542F1_IFJ_OBJ_ATTR (ID);
But received the error
ERROR 1022 (23000): Can't write; duplicate key in table '#sql-9ec8_126fa'
Currently Insight does not recognize any of the existing objects or object schemas