Is there a helpful tool or script resource to aid conver开发者_开发问答sion from old-school adjacency list tables to MPTT?
I would have thought it was a problem faced by a few cleverer souls than I in the past, and thought I'd check here first in case they came up with a clever solution in their travels - before embarking on my own journey to do such a thing.
This link includes code to make the conversion. Look at the bottom for the SQL version of the code (there's also a PHP script to do it).
I know that I've seen code from Joe Celko on how to do it, but I don't recall if that was on the intertubes or in his book on trees and hierarchies in SQL.
精彩评论