← All docs

Ecto (Elixir)

Elixir

Ecto migrations are Elixir modules. Use raw SQL execute statements for best results.

Auto-Detection

MigrationPilot auto-detects Ecto via mix.exs with ecto or the priv/repo/migrations/ directory.

Migration Path

Default migration file pattern:

priv/repo/migrations/**/*.sql

Setup

# Ecto migrations are Elixir files.
# For SQL analysis, use execute() with raw SQL in your migrations:
#
#   execute "CREATE INDEX CONCURRENTLY ..."
#
# Extract SQL from migration files or use ecto.migrate --log-sql

GitHub Action

Add to your CI workflow:

- name: Check Ecto migrations
  run: |
    mix ecto.migrate --log-sql 2>&1 | npx migrationpilot analyze --stdin --fail-on critical

Configuration

Add a config file to set the default migration path:

# .migrationpilotrc.yml
migrationPath: "priv/repo/migrations/**/*.sql"
failOn: critical