Skip to content

Passing prefix to the Migrator results in error (Postgres) #118

@jk-lamb

Description

@jk-lamb

In the target up:

defmodule KantaTest.Repo.Migrations.UpdateKantaMigrations do
  use Ecto.Migration

  def up do
    Kanta.Migration.up(version: 4, prefix: "kanta")
  end

  def down do
    Kanta.Migration.down(version: 4, prefix: "kanta")
  end
end

returns:

12:34:39.843 [info] execute "  ALTER TABLE kanta.kanta_messages\n    ADD COLUMN IF NOT EXISTS searchable tsvector\n    GENERATED ALWAYS AS (\n      setweight(to_tsvector('english', coalesce(msgid, '')), 'A')\n    ) STORED;\n"
** (Postgrex.Error) ERROR 3F000 (invalid_schema_name) schema "kanta" does not exist
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1096: Ecto.Adapters.SQL.raise_sql_call_error/1
    (elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1203: Ecto.Adapters.SQL.execute_ddl/4
    (ecto_sql 3.12.1) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
    (elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
    (kanta 0.4.1) lib/kanta/migrations/postgresql/v04.ex:19: Kanta.Migrations.Postgresql.V04.up/1
    (kanta 0.4.1) lib/kanta/migrations/postgresql.ex:73: anonymous fn/4 in Kanta.Migrations.Postgresql.change/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions