Drop doc['ver'] from required schema
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dmedia |
Fix Released
|
High
|
Jason Gerard DeRose |
Bug Description
As we approach production-ready, I've been looking over the schema with a critical eye for stuff that isn't actually being used.
For one, we want the critical schema that drives the automation behaviors to be just what's actually used, because we don't want to make long-term commitments to schema that we don't need. Testing and review are also easier when we only use essential schema.
For another, the dmedia/file docs will get updated quite often, and so the smaller we can make them, the less of an issue the CouchDB append-only database files will be.
doc['ver'] seemed like a good idea back in the day as a way to make each document identify its schema version. But now we have versioned databases instead, and upgrading the schema a database at a time is what makes sense. It's non-destructive, and it provides the flexibility needed for arbitrary schema upgrades.
So I'm removing doc['ver']. If we need it in the future, we can treat a missing doc['ver'] as version zero, and use {'ver': 1} for version 1, and so on.
Related branches
- James Raymond: Approve
-
Diff: 556 lines (+180/-64)6 files modifieddmedia/jobs.py (+2/-1)
dmedia/schema.py (+0/-23)
dmedia/tests/test_importer.py (+0/-1)
dmedia/tests/test_schema.py (+1/-31)
dmedia/tests/test_views.py (+177/-1)
dmedia/views.py (+0/-7)
Changed in dmedia: | |
status: | In Progress → Fix Committed |
Changed in dmedia: | |
status: | Fix Committed → Fix Released |
One note on the document size, to to point out how much of a reduction is possible: in some tests with real Dmedia documents with our current schema, I got the serialized document size down to less than have the current size by reducing things to only the truly essential schema.