mirror of
https://github.com/plausible/analytics.git
synced 2024-12-22 17:11:36 +03:00
Clickhouse migration: add ingest_counters table (#2692)
* Clickhouse migration: add ingest_counters table * Add toStartOfMinute() to ordering key * Explicitly include column to be summarized
This commit is contained in:
parent
bc557b78fd
commit
043e3ed572
@ -0,0 +1,15 @@
|
||||
defmodule Plausible.IngestRepo.Migrations.CreateIngestCountersTable do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create_if_not_exists table(:ingest_counters,
|
||||
engine: "SummingMergeTree(value) ORDER BY (domain, toDate(event_timebucket), metric, toStartOfMinute(event_timebucket))") do
|
||||
|
||||
add(:event_timebucket, :utc_datetime)
|
||||
add(:domain, :"LowCardinality(String)")
|
||||
add(:site_id, :"Nullable(UInt64)")
|
||||
add(:metric, :"LowCardinality(String)")
|
||||
add(:value, :UInt64)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user