0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/ee/clickhouse/migrations/0022_person_distinct_id2.py
Karl-Aksel Puulmann 78a787bc3b
Create and populate person_distinct_id2 table, add versioning to person_distinct_id (#7576)
* Migration to add version to person_distinct_id

* Update plugin-server type

* Use queueMessages instead of for loops

* Update distinct id versions in postgres

* Add commented out new query

* Add person_distinct_id2 table setup/migration

This will be used for more efficient person_distinct_id queries

* Avoid sharding person_distinct_id2 on cloud

* Write to new distinct ids topic

* Attempt to use version in tests

* Tests attempt 2

* Fixup version - dont send with all messages

* Flush kafka more frequently

* Actually fix tests

* Add another await

* Add partition to person_distinct_id2 table
2021-12-08 16:47:57 +02:00

14 lines
379 B
Python

from infi.clickhouse_orm import migrations
from ee.clickhouse.sql.person import (
KAFKA_PERSON_DISTINCT_ID2_TABLE_SQL,
PERSON_DISTINCT_ID2_MV_SQL,
PERSON_DISTINCT_ID2_TABLE_SQL,
)
operations = [
migrations.RunSQL(PERSON_DISTINCT_ID2_TABLE_SQL()),
migrations.RunSQL(KAFKA_PERSON_DISTINCT_ID2_TABLE_SQL),
migrations.RunSQL(PERSON_DISTINCT_ID2_MV_SQL,),
]