Skip to content

Instantly share code, notes, and snippets.

@ssmusoke
Created February 14, 2020 10:05
Show Gist options
  • Save ssmusoke/745ffc235945f1cae95693b050232c44 to your computer and use it in GitHub Desktop.
Save ssmusoke/745ffc235945f1cae95693b050232c44 to your computer and use it in GitHub Desktop.
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS = @@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION = @@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE = @@TIME_ZONE */;
/*!40103 SET TIME_ZONE = '+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */;
/*!40101 SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES = @@SQL_NOTES, SQL_NOTES = 0 */;
/* Increase the concept IDs by 1000000 for custom concepts created */
UPDATE concept SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
/* Move duplicate uuid for concepts - these will show up as errors during startup */
UPDATE concept SET uuid = 'b1fc0acf-f67c-4b6d-976b-c388876ce373' WHERE uuid = '38aa1dc0-1aaa-4bdd-b26f-28f960dfb16c';
/* Move the ids for different concepts entries */
UPDATE concept_answer SET concept_answer_id = concept_answer_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_answer SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_answer SET answer_concept = answer_concept + 1000000 WHERE answer_concept > 163139;
UPDATE concept_description SET concept_description_id = concept_description_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_description SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
-- Fix the uuid values of the concept name
UPDATE concept_name SET uuid = UUID() WHERE concept_id > 163139;
UPDATE concept_name SET concept_name_id = concept_name_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_name SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_numeric SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_set SET concept_set_id = concept_set_id + 1000000 WHERE concept_id > 163139;
UPDATE concept_set SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
/* move the concept obs */
UPDATE obs SET concept_id = concept_id + 1000000 WHERE concept_id > 163139;
/* Move the coded obs */
UPDATE obs SET value_coded = value_coded + 1000000 WHERE value_coded > 163139;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment