open-contracting / kingfisher-summarize

Creates SQL tables that summarize the OCDS data in collections from Kingfisher Process
https://kingfisher-summarize.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
3 stars 8 forks source link

Add meta table with protected column #194

Closed jpmckinney closed 3 years ago

jpmckinney commented 3 years ago

This would be a new table for general metadata about the schema. For now it would have a protected boolean column and a created_at datetime column.

This would be read by a cron job that determines whether a schema can be deleted (after 6 months).

The selected_collections and note tables have multiple rows for each collection/note, so we can't reuse those without changing them to e.g. Array or JSON fields. Doing that is maybe fine, too.

We would add a CLI command to mark/unmark a schema as protected.

jpmckinney commented 3 years ago

This is instead controlled by an environment variable (see stale command source code). If all the source collections are deleted, then the schema is deleted, unless it is protected. This avoids having to separately track the creation date.