forked from plausible/analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redo migration: Add scroll_depth to imported_pages (plausible#4926)
* add migration * rename migration file and change column type to Nullable(UInt64)
- Loading branch information
1 parent
f4f4d70
commit 27422f0
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
priv/ingest_repo/migrations/20241218102326_drop_and_add_scroll_depth_to_imported_pages.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule Plausible.IngestRepo.Migrations.DropAndAddScrollDepthToImportedPages do | ||
use Ecto.Migration | ||
|
||
@on_cluster Plausible.MigrationUtils.on_cluster_statement("imported_pages") | ||
|
||
def up do | ||
execute """ | ||
ALTER TABLE imported_pages | ||
#{@on_cluster} | ||
DROP COLUMN scroll_depth | ||
""" | ||
|
||
execute """ | ||
ALTER TABLE imported_pages | ||
#{@on_cluster} | ||
ADD COLUMN scroll_depth Nullable(UInt64) | ||
""" | ||
end | ||
|
||
def down do | ||
execute """ | ||
ALTER TABLE imported_pages | ||
#{@on_cluster} | ||
DROP COLUMN scroll_depth | ||
""" | ||
end | ||
end |