Ecto migration to move sessions_v2 to VersionedCollapsingMergeTree (#3809)

This migration will noop in staging/production as it already has been run. It also leaves
behind a backup table that initially takes no extra space but will need to be cleaned up
manually
This commit is contained in:
Karl-Aksel Puulmann 2024-02-28 11:22:27 +02:00 committed by GitHub
parent 39aa81a16f
commit ea38b45685
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,7 @@ All notable changes to this project will be documented in this file.
- Replace `CLICKHOUSE_MAX_BUFFER_SIZE` with `CLICKHOUSE_MAX_BUFFER_SIZE_BYTES`
### Fixed
- Using `VersionedCollapsingMergeTree` to store visit data to avoid rare race conditions that led to wrong visit data being shown
- Fix `conversion_rate` metric in a `browser_versions` breakdown
- Calculate `conversion_rate` percentage change in the same way like `bounce_rate` (subtraction instead of division)
- Calculate `bounce_rate` percentage change in the Stats API in the same way as it's done in the dashboard

View File

@ -0,0 +1,13 @@
defmodule Plausible.IngestRepo.Migrations.SessionsV2VersionedCollapsingMergeTree do
use Ecto.Migration
def up do
Plausible.DataMigration.VersionedSessions.run(run_exchange?: true)
# After this migration a `sessions_v2_tmp_versioned` backup table is left behind, to be cleaned up manually
end
def down do
raise "Irreversible"
end
end