pculture/miro — pull request #215 by bendk (2012-02-23 05:08:48+00:00)
Title: Fix18756

Please don't merge yet, this contains a bunch of changes to how we handle on devices. I'd be happy to get some review though.

The main point of all of this is to try to make device database handling work better as devices pass between miro versions. This meant making it so that the current code outputs things in a way that previous versions can deal with.

Also it meant trying to change the metadata/metadata_status schemas in a way so that future versions can change the schema and still work with this version. I'm thinking the process would go something like this:
- Suppose Miro 6.0 adds a new metadata processor called "foo"
- we add a foo_status column and set it to noneOk=True. I think this means that older versions can still read/write to the database and when it writes to the database the column is set to NULL.
- if NULL isn't okay, we can add code that runs an upgrade by selecting all the rows where foo_status is NULL.
- We change the value that gets set to finished_status to 2. This way if miro 6.0 sets finished_status, then Miro 5.0 will know that it doesn't need to run any metadata processors either. But if Miro 5.0 sets it, then Miro 6.0 will still get a chance to run the new processor.