# Migration a legacy Recruitment Process in the new Screening

## Find the original process

Is important identify what recruitment proceces must to be migrated. 
1. In Mysql data base find the stages related with the recruitment process
  - Table: global_application_stage
  - Params: country, program and location
```sql
SELECT * FROM `ss_dev`.`global_application_stage`
WHERE
  `country` = 'es'
  AND `programId` = 211
  AND `locationId` = 930;
```
  ![Image of Stages](./stages_found.png)

2. Now, if you can found stages is required insert the recruitment process
```sql
  INSERT INTO `ss_dev`.`global_recruitment_process` 
    (`title`, `countryId`, `countryCode`, `programId`, `locationId`, `createdAt`, `updatedAt`, `ssRPId`, `active`, `status`) 
  VALUES 
    ('[ORIGINAL] ES-211-930', '1', 'es', '211', '930', '2020-07-23 22:44:15', '2020-07-23 22:44:15', 'TEMPORAL-UUID-1-221-930', '1', 'active');
```

3. After you must add to each stage found the ```ssRPId``` and create a temporal uuid in ```ssStageId```

![Image of temporal uuid Stages](./temporal_uuid.png)

```sql
UPDATE `ss_dev`.`global_application_stage` SET `ssRPId` = 'TEMPORAL-UUID-1-221-930', `ssStageId` = 'TEMPORAL-UUID-STAGE-1-1-221-930' WHERE (`id` = '1640');
```