v2.0 to v2.1.0 Migration error: Column with this name already exists #4595
-
Hi,
This "utm_medium" column is already present in both events_v2 and sessions_v2 tables. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
There are several quick fixes possible but it might not solve everything as the root cause might be more complicated than just a failed migration. The first fix I can think of is to insert the failing migration version into schema_versions table in ClickHouse and that would make it skip it since it would think it has already run it. Another possible fix is to drop that column if it doesn’t have any data. The real fix though would be to get to the root cause of this and find put why this column already exists in your tables :) |
Beta Was this translation helpful? Give feedback.
Judging by
clickhouse-0.clickhouse.default.svc.cluster.local
you might be running a ClickHouse cluster. That might also explain the error if the events or sessions tables are replicated butschema_migrations
is not. In that scenario Plausible might attempt to run migrations that have already been run before. The fix might be to makeschema_migrations
replicated. The fact thatutm_medium
columns are only defined in very old migrations (way way pre-v2) seems to support it: https://github.com/search?q=repo%3Aplausible%2Fanalytics+path%3A%2F%5Epriv%5C%2Fingest_repo%5C%2Fmigrations%5C%2F%2F+utm_medium&type=code