View Source Plausible.DataMigration.RewriteFunnelDupes (Plausible v0.0.1)
A data fix migration that seeks funnels having steps whose goals are equally named. It then tries to rewrite the duplicate goals using the oldest goal available. In extreme cases, e.g. when multiple duplicates are found for a single funnel, it will either reduce or completely remove the funnel. This enables us to run a migration later on that will delete duplicate goals and enforce goal uniqueness at the database level via a CHECK constraint.
To run, just call the run
function.