Skip to content

Commit f1b29aa

Browse files
authored
Allow for setting the skip_table_creation opt (#184)
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.
1 parent bb3504e commit f1b29aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/phoenix_ecto/check_repo_status.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ defmodule Phoenix.Ecto.CheckRepoStatus do
1111
* `: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
1212
* `:migration_lock` - the locking strategy used by the Ecto Adapter when checking for pending migrations. Set to `false` to disable migration locks.
1313
* `:prefix` - the prefix used to check for pending migrations.
14+
* `: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
1415
"""
1516

1617
@behaviour Plug
1718

1819
alias Plug.Conn
1920

20-
@migration_opts [:migration_lock, :prefix]
21+
@migration_opts [:migration_lock, :prefix, :skip_table_creation]
2122
@compile {:no_warn_undefined, Ecto.Migrator}
2223

2324
def init(opts) do

0 commit comments

Comments
 (0)