Skip to content

Meilisearch cache_version #932

@markhilb

Description

@markhilb

Current Status

Currently, hauls and trips have a column cache_version in the database that gets incremented every time the row is updated through triggers.
This causes the Meilisearch worker to update these values in the cache.
Similarly, landings has a column version that works the same way, however, this column comes from the raw CSV data and is not managed by us because we never update the landings table.

After PR #930

PR #930 added trip_id to the Haul and Landing.
This means that every time a haul or landing gets connected/disconnected from a trip their cache_version needs to be incremented (for landings we also need to add a cache_version column instead of using the version field).

The cache_versions can be incremented in two ways:

  1. A trigger on vessel_events that increments the cache_version of its corresponding haul/landing.
  2. Modify every query that updates vessel_events to also increment the cache_version of its corresponding haul/landing.

Caution

These changes must be implemented before we can deploy the Meilisearch cache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions