WARNING
This table is not visible in the Strapi admin panel. Access only through database
Runrecords
singularName: runrecordpluralName: runrecords
Connects the member and run tables to produce a track record for each member showing all the runs he/she attended
Schema
| Name | Type | Details |
|---|---|---|
| member | relation | manyToOne → Members |
| run_summary | string | |
| member_alias | string | |
| run | relation | manyToOne → Hareline |
Lifecycles
beforeCreate (async)
Lifecycle method triggered before creating a new run record entry. It fetches the alias of the associated member and the summary of the associated run, and adds them to the entry.
Parameters:
event: - The event object containing the parameters for the new run record entry.
afterCreate (async)
Lifecycle method triggered after creating a new run record entry. It updates the actualRuns field of the associated member with the new value.
Parameters:
event: - The event object containing the newly created run record entry.
beforeDelete (async)
Lifecycle method triggered before deleting a run record entry. It updates the actualRuns field of the associated member with the decremented value. This is done because afterDelete doesn't work here, as the record is already gone.
Parameters:
event: - The event object containing the parameters for the deletion.
beforeUpdate (async)
Lifecycle method triggered before updating an existing run record entry. It throws an error because run records should not be updated. Instead, the existing record should be deleted and a new record created.
Parameters:
event: - The event object containing the parameters for the updated run record entry.
