Artur-Sulej / excellent_migrations

An Elixir tool for checking safety of database migrations.
MIT License
232 stars 25 forks source link

Feature Request: Configurable migrations paths #6

Open axelson opened 2 years ago

axelson commented 2 years ago

Currently when called by credo it's not possible to specify the migration path because it's hard-coded in relevant_file?/2:

  def relevant_file?(path, start_after) do
    !String.starts_with?(path, ["deps/", "_build/"]) &&
      !String.contains?(path, ["/deps/", "/_build/"]) &&
      String.contains?(path, "migrations/") &&
      migration_timestamp(path) > start_after
  end

This causes an issue because I'm using data migrations (similarly to how it's spelled out here: https://fly.io/phoenix-files/backfilling-data/) that are stored in priv/data_migrations/ and I'd like excellent migrations to ignore them because I do plan to use Repo operations within them (and they have a whole host of other considerations).

Artur-Sulej commented 2 years ago

Thanks for sharing this. Would you like to create a pull request with this change?

kraleppa commented 1 year ago

Hey, I've created a PR for this one https://github.com/Artur-Sulej/excellent_migrations/pull/29