learning-unlimited/ESP-Website — pull request #671 by gkanwar (2013-07-28 21:28:40+00:00)
Title: Schema simplification

Rebases #657 on top of master. Comment from #657:

This is a major set of changes, mostly that Taylor made as part of his GSoC project last summer. The basic idea is to eliminate the DataTree and UserBits from our system entirely, and use a combination of new and existing model fields to track the same information in a more straightforward way. Some examples:

* Teachers is now a many-to-many-field on ClassSubject
* The Record model keeps track of when a user completed an action (e.g. signing up for teacher training, completing a survey)
* The Permission model keeps track of permissions
* A lot of models now refer directly to a Program instead of a DataTree "anchor"

Furthermore, the accounting system has been rewritten (by me) to be simpler and not depend on the DataTree. It has the same principle of using transactions to move money between accounts, but it should be significantly easier to use.

I've tested that all the migrations work against my copy of the MIT database. Some unused/old tables with naming conflicts need to be removed, and some initial migrations need to be faked... and then it takes a long time to run. Nothing appears horribly broken, but obviously this needs thorough testing and code review before we unleash it on our sites.