Skip to content

Commit

Permalink
Allow for setting the skip_table_creation opt (#184)
Browse files Browse the repository at this point in the history
In scenarios where you might be running your local dev environment in such a way that the database user does not have create table permissions this allows you to configure the `CheckRepoStatus` Plug in such a way that it won't constantly report a misleading error about the migration table not existing.
  • Loading branch information
LeakyBucket authored Nov 23, 2024
1 parent bb3504e commit f1b29aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/phoenix_ecto/check_repo_status.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ defmodule Phoenix.Ecto.CheckRepoStatus do
* `:migration_paths` - a function that accepts a repo and returns a migration directory, or a list of migration directories, that is used to check for pending migrations
* `:migration_lock` - the locking strategy used by the Ecto Adapter when checking for pending migrations. Set to `false` to disable migration locks.
* `:prefix` - the prefix used to check for pending migrations.
* `:skip_table_creation` - Ecto will not try to create the `schema_migrations` table automatically. This is useful if you are connecting as a DB user without create permissions
"""

@behaviour Plug

alias Plug.Conn

@migration_opts [:migration_lock, :prefix]
@migration_opts [:migration_lock, :prefix, :skip_table_creation]
@compile {:no_warn_undefined, Ecto.Migrator}

def init(opts) do
Expand Down

0 comments on commit f1b29aa

Please sign in to comment.