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.
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 |