{ "ADDITIONALTABLES": { "USERS": "select DISTINCT userkey, username,CUSTOMPROPERTY2,owner,employeeid,CUSTOMPROPERTY7,CUSTOMPROPERTY45 FROM USERS" }, "COMPUTEDCOLUMNS": [ "userkey", "employeeclass", "CUSTOMPROPERTY7", "CUSTOMPROPERTY2", "CUSTOMPROPERTY45", "STATUSKEY", "SECONDARYMANAGER", "MANAGER", "OWNER" ], "PREPROCESSQUERIES": [ "UPDATE NEWUSERDATA SET NEWUSERDATA.employeeclass = 'Employee'", "UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.employeeid = CURRENTUSERS.employeeid SET NEWUSERDATA.CUSTOMPROPERTY7 = CASE WHEN CURRENTUSERS.CUSTOMPROPERTY7 IS NULL THEN (SELECT SUBSTRING(REPLACE(UUID(), '-', ''), 1, 32) AS RandomAlphanumeric) else CURRENTUSERS.CUSTOMPROPERTY7 END", "UPDATE NEWUSERDATA NU LEFT JOIN CURRENTUSERS CU ON NU.employeeid = CU.employeeid SET NU.STATUSKEY = CASE WHEN CU.CUSTOMPROPERTY45 = 'Withdrawn' THEN '0' else '1' END", "UPDATE NEWUSERDATA NU SET NU.OWNER = (select CU.USERNAME from CURRENTUSERS CU where CU.employeeid=NU.CUSTOMPROPERTY2)" ] }