https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29457
--- Comment #31 from Marcel de Rooy <[email protected]> --- NOTE: This comment is referred to from the db revision of this report ! If you come here since a Koha upgrade referred you to this place, you have two options: (1) try to correct the incorrect manager_id's or (2) clear the incorrect manager_id's. A suggestion beforehand: Make a SQL dump before running the SQL updates below on your (production) data. OPTION 1 CORRECT In the more exceptional case that your records contain a numeric manager_id which actually is a USERID (read: user code) and NOT a borrowernumber, you may want to run this sql statement: UPDATE accountlines LEFT JOIN borrowers ON CAST(borrowers.userid AS INT) = accountlines.manager_id SET manager_id = borrowers.borrowernumber WHERE manager_id IS NOT NULL AND userid RLIKE "^[0-9]+$" AND borrowers.borrowernumber IS NOT NULL AND credit_type_code = 'CANCELLATION' OPTION 2 CLEAR Use this SQL statement to correct records with a wrong wrong manager_id, setting them to NULL: UPDATE accountlines SET manager_id = NULL WHERE manager_id IS NOT NULL AND credit_type_code = 'CANCELLATION' -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
