analytics/priv/ingest_repo/migrations/20230214114402_create_ingest_counters_table.exs
Adam 6d79ca5093
Switch to new clickhouse adapter (ch/chto) (#2733)
* another clickhouse adapter

* don't restore stats_removal.ex

* fix events main-graph error (#2746)

* update ch, chto

* update chto again (#2759)

* Stop treating page filter as an entry_page filter (#2752)

* remove dead code

* stop treating page filter as entry page filter in breakdown queries

* stop treating page filter as entry page filter in aggregate queries

* stop treating page filter as entry page filter in timeseries queries

* mix format

* update changelog

* break code down to smaller functions to keep credo happy

* remove unused functions

* make CSV export return only conversions with goal filter (#2760)

* make CSV export return only conversions with goal filter

* update changelog

* update elixir version in mix.exs (#2742)

* revert admin.ex changes (#2776)

---------

Co-authored-by: ruslandoga <67764432+ruslandoga@users.noreply.github.com>
Co-authored-by: ruslandoga <rusl@n-do.ga>
Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
2023-03-21 09:55:59 +01:00

19 lines
673 B
Elixir

defmodule Plausible.IngestRepo.Migrations.CreateIngestCountersTable do
use Ecto.Migration
def change do
create_if_not_exists table(:ingest_counters,
primary_key: false,
engine: "SummingMergeTree(value)",
options:
"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