Dec 15, 2020
0
Level 14
Document revisions relationship
I have a database model Document, a document can have past revisions of itself. The data looks like
- id
- name
- parent_document_id
When a new revision is uploaded the old documents parent_document_id gets set to the new documents id.
I need a way to get all past revisions of a document. Preferably I'd like to use the query builder (or something) so that I can group the revisions by date.
Example
Tuesday, December 15, 2020
- 12:00 pm | revision-4.xlsx | Created By User: Foo
- 11:00 am | revision-3.xlsx | Created By User: Jim
Monday, December 14, 2020
- 12:00 pm | revision-4.xlsx | Created By User: Foo
- 11:00 am | revision-3.xlsx | Created By User: Jim
Please or to participate in this conversation.