snap-cloud / snapCloud

Official cloud backend and community site for the Snap! programming language
https://snap.berkeley.edu/
GNU General Public License v3.0
52 stars 28 forks source link

Grab the entire remix tree #175

Open cycomachead opened 5 years ago

cycomachead commented 5 years ago

Lower priority. Getting remixes should load the entire tree.

bromagosa commented 5 years ago

Hmm, I wouldn't say this is lower priority. Collections come before this, but I think this should come right after that :)

cycomachead commented 5 years ago

This is annoying to figure out how to do well. At least with the current structure. It might make sense to add a 'root_project_id' to the remixes table. Since it seems easier to go backwards up a tree than down (at least in SQL).

cycomachead commented 5 years ago

Never mind! I figured it out with some googling and the always helpful postgres wiki

https://snap-analytics.cs10.org/question/124

bromagosa commented 5 years ago

We'll also need the inverse: get the root from any remix node.

This is so we can always credit the original author from any of its remixes, however deep they are.

cycomachead commented 5 years ago

Yeah. That makes sense. The inverse is a bit easier to construct. I’ll add a method for that when I handle getting the tree.