diff --git a/scripts/pb-add-dn-batches.py b/scripts/pb-add-dn-batches.py index 98cfbf7..a440144 100755 --- a/scripts/pb-add-dn-batches.py +++ b/scripts/pb-add-dn-batches.py @@ -133,6 +133,19 @@ def main(): {"name": "page_to", "type": "number", "required": False}, ]) + # Repair the standard system date fields on both new collections + # if they were created before this script knew to include them. The + # `create_collection` path only fires for from-scratch creates; + # add_fields is the path that heals an existing live collection. + add_fields(token, "dn_batches", [ + {"name": "created", "type": "date", "required": False, "onCreate": True}, + {"name": "updated", "type": "date", "required": False, "onCreate": True, "onUpdate": True}, + ]) + add_fields(token, "dn_batch_notes", [ + {"name": "created", "type": "date", "required": False, "onCreate": True}, + {"name": "updated", "type": "date", "required": False, "onCreate": True, "onUpdate": True}, + ]) + if __name__ == "__main__": main()