Repository navigation
AirModel 0.4.0: Auto-migration for new model fields
Add a field to your model, call create_tables(), and the column appears in PostgreSQL. No manual ALTER TABLE, no migration tool for the common case of adding fields to an existing model.
uv add --upgrade AirModelWhat's new
create_tables()migrates existing tables. After runningCREATE TABLE IF NOT EXISTS, AirModel checksinformation_schema.columnsand runsALTER TABLE ADD COLUMNfor any model fields not yet in the database. Non-destructive: never drops columns, never changes types. New columns are added withoutNOT NULLso existing rows stay intact, while Pydantic still enforces requirements at the app layer.
What's better
- Documentation for
create_tables()updated across the README and usage guide to describe the migration behavior. - README leads with project links (GitHub, PyPI, docs) for faster navigation.
- Latest patterns pulled from Cookiecutter PyPackage.
Contributors
@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release: the auto-migration feature, its test coverage, and the documentation updates.