apply_migration
Execute SQL migration scripts securely within a transaction and track them in the supabase_migrations.schema_migrations table for self-hosted Supabase databases.
Instructions
Applies a SQL migration script and records it in the supabase_migrations.schema_migrations table within a transaction.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
name | No | An optional descriptive name for the migration. | |
sql | Yes | The SQL DDL content of the migration. | |
version | Yes | The migration version string (e.g., '20240101120000'). |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"description": "An optional descriptive name for the migration.",
"type": "string"
},
"sql": {
"description": "The SQL DDL content of the migration.",
"type": "string"
},
"version": {
"description": "The migration version string (e.g., '20240101120000').",
"type": "string"
}
},
"required": [
"version",
"sql"
],
"type": "object"
}