# prisma-next migration ref (/docs/cli/next/migration-ref)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Manage named Prisma Next migration refs.

Location: CLI > Next > prisma-next migration ref

`prisma-next migration ref` manages named refs stored with your migration history.

Refs let you name a migration hash and use that name in commands such as [`prisma-next migration apply --ref <name>`](https://www.prisma.io/docs/cli/next/migration-apply).

## Usage [#usage]

```bash
prisma-next migration ref set production sha256:abc...
prisma-next migration ref get production
prisma-next migration ref list
prisma-next migration ref delete production
```

## Subcommands [#subcommands]

| Subcommand          | What it does               |
| ------------------- | -------------------------- |
| `set <name> <hash>` | Writes or updates a ref.   |
| `get <name>`        | Prints the hash for a ref. |
| `list`              | Lists all refs.            |
| `delete <name>`     | Deletes a ref.             |

## Options [#options]

| Option            | What it does                                   |
| ----------------- | ---------------------------------------------- |
| `--config <path>` | Reads a specific `prisma-next.config.ts` file. |
| `--json`          | Prints a machine-readable result.              |

## Example workflow [#example-workflow]

```bash
prisma-next migration ref set production sha256:abc...
prisma-next migration status --db "$DATABASE_URL" --ref production
prisma-next migration apply --db "$DATABASE_URL" --ref production
```

Use refs when environments need named targets instead of always applying to the latest migration on disk.

## Related pages

- [`CLI configuration`](https://www.prisma.io/docs/cli/next/configuration): Configure Prisma Next CLI commands with prisma-next.config.ts and global flags.
- [`prisma-next contract emit`](https://www.prisma.io/docs/cli/next/contract-emit): Emit Prisma Next contract artifacts.
- [`prisma-next contract infer`](https://www.prisma.io/docs/cli/next/contract-infer): Infer a starter contract from an existing database.
- [`prisma-next db init`](https://www.prisma.io/docs/cli/next/db-init): Initialize a database from the current Prisma Next contract.
- [`prisma-next db schema`](https://www.prisma.io/docs/cli/next/db-schema): Inspect a live database schema.