generate_migration_from_models
Generates a migration file from Pydantic model definitions, creating SQL tables that match the model schemas. Returns the migration code as a string for immediate use.
Instructions
Generate a migration file from Pydantic model definitions.
Parses model definitions and creates a migration that creates tables matching the model schemas. Returns the migration code as a string.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"models_code": "<models_code>"
},
"name": "generate_migration_from_models"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db_path | No | app.db | |
| models_code | Yes | ||
| migration_name | No | auto_migration |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |