diff --git a/lib/plausible/clickhouse_event_v2.ex b/lib/plausible/clickhouse_event_v2.ex index 3071f2539..61a50b63d 100644 --- a/lib/plausible/clickhouse_event_v2.ex +++ b/lib/plausible/clickhouse_event_v2.ex @@ -22,27 +22,6 @@ defmodule Plausible.ClickhouseEventV2 do field :revenue_source_currency, Ch, type: "FixedString(3)" field :revenue_reporting_amount, Ch, type: "Nullable(Decimal64(3))" field :revenue_reporting_currency, Ch, type: "FixedString(3)" - - # Fields which are in the schema but not managed by us anymore. - # field :referrer, :string - # field :referrer_source, :string - # field :utm_medium, :string - # field :utm_source, :string - # field :utm_campaign, :string - # field :utm_content, :string - # field :utm_term, :string - - # field :country_code, Ch, type: "FixedString(2)" - # field :subdivision1_code, Ch, type: "LowCardinality(String)" - # field :subdivision2_code, Ch, type: "LowCardinality(String)" - # field :city_geoname_id, Ch, type: "UInt32" - - # field :screen_size, Ch, type: "LowCardinality(String)" - # field :operating_system, Ch, type: "LowCardinality(String)" - # field :operating_system_version, Ch, type: "LowCardinality(String)" - # field :browser, Ch, type: "LowCardinality(String)" - # field :browser_version, Ch, type: "LowCardinality(String)" - # field :transferred_from, :string end def new(attrs) do diff --git a/priv/ingest_repo/migrations/20240220081207_drop_event_session_columns.exs b/priv/ingest_repo/migrations/20240220081207_drop_event_session_columns.exs new file mode 100644 index 000000000..25fb38935 --- /dev/null +++ b/priv/ingest_repo/migrations/20240220081207_drop_event_session_columns.exs @@ -0,0 +1,31 @@ +defmodule Plausible.IngestRepo.Migrations.DropEventSessionColumns do + use Ecto.Migration + + @dropped_columns [ + :referrer, + :referrer_source, + :utm_medium, + :utm_source, + :utm_campaign, + :utm_content, + :utm_term, + :country_code, + :subdivision1_code, + :subdivision2_code, + :city_geoname_id, + :screen_size, + :operating_system, + :operating_system_version, + :browser, + :browser_version, + :transferred_from + ] + + def change do + alter table(:events_v2) do + for column <- @dropped_columns do + remove(column) + end + end + end +end