I have two tables, applications
and applicationRevisions
, structured:
applications (id, time, user, views)
applicationRevisions(id, application, time, user, name, description)
The latter holds 'revisions' of an application page, containing title and description, so it's a one-to-many relationship. When an application page is shown, the latest applicationRevisions
row with the matching application
ID is chosen.
However, I have no way of knowing if an application with a certain name exists at any particular time because previous revisions may have different names, and the name is not stored in the applications
table.
I have a workarounds; store the current name as a field in applications
, and when an application is edited, add the row as usual to applicationRevisions
, but then update the name
in the applications
row.
Is there a better way to do this?