Just in case you missed the previous post about the architectural changes we’ll be making to GlitterGallery, you can find that here.
Since Glimages will now be shown through the blob object’s data, there’s actually an advantage – we can now support comments for every point in history for a particular Glimage. The URL for a particular commit will contain the sha for the commit. (An SHA is unique to a commit).
So, all we have to do now, is grab that SHA, and assign that to a comment. Just like we relied on the glimage_id column earlier, we’ll now rely on the commit’s SHA for the same!
Of course, we’ll want to assign these comments to Glitterposts as well, so’ll actually be dealing with two columns. type and type_id. It probably makes sense to prettify things a bit, so we’ll organize our tables in this fashion (comment_holder connects those two tables):