From e82ae6599d085129a4f5668212329cc7db2116d3 Mon Sep 17 00:00:00 2001 From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:32:37 +0100 Subject: [PATCH] Migration: Add scroll_depth to imported_pages (#4908) * add migration * add down fn --- ...031_add_scroll_depth_to_imported_pages.exs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 priv/ingest_repo/migrations/20241216133031_add_scroll_depth_to_imported_pages.exs diff --git a/priv/ingest_repo/migrations/20241216133031_add_scroll_depth_to_imported_pages.exs b/priv/ingest_repo/migrations/20241216133031_add_scroll_depth_to_imported_pages.exs new file mode 100644 index 0000000000..d3a50e5dd7 --- /dev/null +++ b/priv/ingest_repo/migrations/20241216133031_add_scroll_depth_to_imported_pages.exs @@ -0,0 +1,21 @@ +defmodule Plausible.IngestRepo.Migrations.AddScrollDepthToImportedPages do + use Ecto.Migration + + @on_cluster Plausible.MigrationUtils.on_cluster_statement("imported_pages") + + def up do + execute """ + ALTER TABLE imported_pages + #{@on_cluster} + ADD COLUMN scroll_depth UInt8 DEFAULT 255 + """ + end + + def down do + execute """ + ALTER TABLE imported_pages + #{@on_cluster} + DROP COLUMN scroll_depth + """ + end +end