Skip to content

Re-running importers results in duplicate data #54

@c6andy

Description

@c6andy

Currently we need to run php artisan migrate:fresh before re-running importers, otherwise some data will end up duplicated in the database.

If we want to update a dataset from a new source fixture, we’ll need to manually truncate the relevant table, in order to then run the individual importer.

Ideally, importers would be idempotent – importers would ‘upsert’ instead of ‘insert’, and re-running importers on the same source data would have no effect.

To achieve this, we’d need an external ID to be added to each database table, that we can key on to check uniqueness. Many (possibly all?) the data sources have this, but they’re not always added to the database currently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions