From acdf9437fa5a8b84d62e8a8a337a03dd8797642b Mon Sep 17 00:00:00 2001 From: Logan Raarup Date: Tue, 24 Dec 2024 12:23:52 +0100 Subject: [PATCH] Accept prefix option for PostgreSQL v04 migration (#121) The latest migration for PostgreSQL ignores the `prefix` option, causing the migration to fail when previous migrations were not using the `public` schema. This PR adds the `prefix` option to the `v04` migration. --- lib/error_tracker/migration/postgres/v04.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/error_tracker/migration/postgres/v04.ex b/lib/error_tracker/migration/postgres/v04.ex index 1fb05a1..9a6b82e 100644 --- a/lib/error_tracker/migration/postgres/v04.ex +++ b/lib/error_tracker/migration/postgres/v04.ex @@ -3,14 +3,14 @@ defmodule ErrorTracker.Migration.Postgres.V04 do use Ecto.Migration - def up(_opts) do - alter table(:error_tracker_occurrences) do + def up(%{prefix: prefix}) do + alter table(:error_tracker_occurrences, prefix: prefix) do add :breadcrumbs, {:array, :string}, default: [], null: false end end - def down(_opts) do - alter table(:error_tracker_occurrences) do + def down(%{prefix: prefix}) do + alter table(:error_tracker_occurrences, prefix: prefix) do remove :breadcrumbs end end