eregs / regulations-core

An engine that supplies the API that allows users to read regulations and their various layers.
Creative Commons Zero v1.0 Universal
17 stars 27 forks source link

Use namespaces when storing layers #45

Closed cmc333333 closed 8 years ago

cmc333333 commented 8 years ago

This adds a doc_type field to layers, currently consisting of two values, 'cfr' and 'preamble' (preventing many potential collisions). This also modifies the URL pattern, which used to be /layer/[layername]/[regulation_label_id]/[version_id] to /layer/[layername]/[doc_type]/[doc_id-which-may-include-slashes] For backwards compatibility, this adds a translation layer between the old format and the new. It does, however, migrate existing data.

For eregs/notice-and-comment#17

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.1%) to 87.824% when pulling 87bd9c18705a88de8eef3b79066c767d71df776b on cmc333333:17-more-layer-tweaks into 45284ea04f94372b4e3b75262b723cb599894be2 on 18F:master.

jmcarp commented 8 years ago

By the way, is it preferable to keep version and label in the same field? I'm wondering if we could have separate columns (with version being nullable) and avoid some confusion (on my part) about building and parsing doc_id strings.

cmc333333 commented 8 years ago

Re splitting out version -- I was originally hoping that we could basically ignore it and treat the combined doc_id like an opaque identifier. Unfortunately, too much other stuff depends on it ATM.

How about I add a comment around that topic and kick the can down the road?

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.2%) to 87.854% when pulling 1ff415396c98d48c469f62309048f325120b06f6 on cmc333333:17-more-layer-tweaks into 45284ea04f94372b4e3b75262b723cb599894be2 on 18F:master.

jmcarp commented 8 years ago

SGTM--I only asked because I was uncertain about the doc_id format, so I think a comment around that is fine.

cmc333333 commented 8 years ago

Thanks for all the feedback @jmcarp ; ready for another round

jmcarp commented 8 years ago

:tada: