# `mix ash_scylla.migrate`
[🔗](https://github.com/ohhi-vn/ash_scylla/blob/main/lib/mix/tasks/ash_scylla.migrate.ex#L15)

Runs pending CQL migrations and applies resource schema changes.

This task:
1. Runs any pending migration files from `priv/migrations` that haven't been
   recorded in the schema migrations tracking table
2. Optionally runs automatic schema migration for all AshScylla resources
   (diffing resource definitions against snapshots)

## Usage

    # Run all pending migrations
    mix ash_scylla.migrate

    # Run migrations up to a specific version
    mix ash_scylla.migrate --to 20240101120000

    # Run a specific number of pending migrations
    mix ash_scylla.migrate --step 3

    # Dry run (show what would be executed)
    mix ash_scylla.migrate --dry-run

    # Use a specific repo
    mix ash_scylla.migrate --repo MyApp.Repo

    # Create keyspace before migrating
    mix ash_scylla.migrate --create-keyspace

    # Only run migration files (skip auto-schema migration)
    mix ash_scylla.migrate --migrations-only

    # Only run auto-schema migration (skip migration files)
    mix ash_scylla.migrate --schemas-only

## Options

  - `--repo` - The repo module to use (defaults to auto-detected repo)
  - `--dry-run` - Print DDL statements without executing them
  - `--create-keyspace` - Create the keyspace before running migrations
  - `--keyspace` - Override the keyspace name
  - `--nodes` - Override the ScyllaDB nodes (comma-separated)
  - `--step` - Run only N pending migrations
  - `--to` - Run migrations up to and including version
  - `--migrations-only` - Only run migration files, skip auto-schema
  - `--schemas-only` - Only run auto-schema migration, skip files
  - `--quiet` - Suppress output

---

*Consult [api-reference.md](api-reference.md) for complete listing*
