Move spreadsheet storage to postgres
Created by: frankduncan
Right now we store the spreadsheet on the hard disk and again in memory. We should instead store it in postgres. This will be a relatively large refactor (relative to the small size of the codebase) as it would involved using an ORM and creating an object structure. This would be a positive refactor, as it would be easier to work with the objects.
The reasoning here is that postgres is more secure. Right now, anyone with filesystem access can look at the data, which may become a problem. It also allows us to do things like split the data off to it's own machine (like heroku), backup more cleanly, migrate more cleanly, etc, etc.
We should also move all the configuration of permissions, wikis, and whatnot that we store via Pickle on the hard disk into a database as well.
In the database, the spreadsheet row columns should be:
- key (from the key_colymn)
- row_no
- sheet_name
- raw_row
- row_as_dict
We don't need to do any selecting on the row data, as searching is handled by whoosh, so we don't need to create a denormalized table where the row is broken out into a cell table that links back to this row table. We also don't need to worry about changing the rows dynamically as loading up a new spreadsheet should delete and replace them all.