Remove redundancy in MongoFields
Compare changes
Removes redundant data storage in mongodb, and moves/renames some fields for consistency #588 (closed).
Upload.name
is renamed to Upload.upload_name
, the field is removed from Calc.metadata
to avoid redundancy, and upload_name
is used consistently in the apiuploader
, published
and with_embargo
fields are removed from Calc.metadata
to avoid redundant storage in mongodb. The data is only stored on the upload level.Upload.published
is removed from mongodb, instead we check if Upload.publish_time
is set. A property called published
is created on Upload for convenience, so it is still possible to do things like upload.published
(it's just not stored as a separate field in the DB).Calc.parser
to Calc.parser_name
for consistency (affects mongodb and api)domain
from Calc.metadata
(the field is either fetched from the parser (if the parser has a domain set) or from the archive files, if set by the parser)processed
from Calc.metadata
, instead we fetch this value by looking at Calc.process_status
license
from Calc.metadata
, and instead created a license
-field on Upload.upload_time
with upload_create_time
in EntryMetadataentry_create_time
and publish_time
to EntryMetadata.Upload.create_time
and Calc.create_time
with Upload.upload_create_time
and Calc.entry_create_time
, for consistency