v1

latestOpenAPI 3.0.02026-07-1734830.3 KB

Execute a database migration

Executes a migration with the provided up and down steps

post/apis/migrate

Request body

namestring required

Name of the migration

datasourcestring required

The data source to use

Example request

{
  "name": "my_migration",
  "up": [
    {
      "args": {
        "source": "default",
        "sql": "CREATE TABLE employees (id TEXT);"
      }
    }
  ],
  "down": [
    {
      "args": {
        "source": "default",
        "sql": "CREATE TABLE employees (id TEXT);"
      }
    }
  ],
  "datasource": "default"
}

Response

Migration executed successfully

namestring

The name of the created migration with a timestamp

Example response

{
  "name": "1745093409829_my_migration"
}