https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33905
--- Comment #28 from Tomás Cohen Arazi (tcohen) <[email protected]> --- (In reply to Martin Renvoize (ashimema) from comment #25) > This all looks pretty solid to me, I like the use of triggers and it's > introduction here is well thought out. > > I did wonder a little about why we need the COALESE on NEW.borrowernumber? I was doing some ideating on the INSERT case where the borrowernumber (AUTO_INCREMENT) is still not generated. I will clean that as it is useless and should be on the UPDATE case. > I've signed off to keep it moving, but the TODO stands I reckon before we > can processed with QA Of course. If there's agreement on this kind of approach I'll finish it. I believe this is crucial to start cleaning our code and set a precedent on better coding practices once we agree on using triggers like this. I still think dcook has a point on this generating a couple extra queries on each INSERT/UPDATE. Having a separate table with a simple UNIQUE constraint could work too, but would imply breaking reports and I've heard of people wanting userid=cardnumber in some scenarios which wouldn't work well with the UNIQUE constraint (i.e. we would end up doing it in the code again or having the need of a trigger). -- 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/
