---
title: "GET /sites/{site_id}/database/migrations/{name}"
method: GET
path: "/sites/{site_id}/database/migrations/{name}"
tags: ["database"]
---

# GET /sites/{site_id}/database/migrations/{name}

`GET /sites/{site_id}/database/migrations/{name}`

Returns the contents of a named migration for the specified branch.

## Query parameters

- `branch` string

## Response `200`

OK

- DatabaseMigrationDetail — A migration with its file contents
  - `version` integer — The migration version number
  - `name` string — The migration name
  - `path` string — The path to the migration file in the deploy bundle
  - `content` string — The raw contents of the migration file

## Other responses

- `404` — Migration, database, or branch not found
- `423` — Database is disabled
- `default` — error

---

[API](https://skmtc.net/netlify/apis/netlify-s-api-documentation.md) · [All operations](https://skmtc.net/netlify/apis/netlify-s-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/netlify/netlify-s-api-documentation/versions/71540d1b5d9d/schema)
