GitPedia
tortoise

tortoise/aerich

A database migrations tool for TortoiseORM, ready to production.

30 Releases
Latest: 8mo ago
v0.9.2Latest
waketzhengwaketzheng·8mo ago·October 10, 2025
GitHub

📋 Changes

  • Support `--offline` for aerich migrate. ([#441])
  • Add `RUN_IN_TRANSACTION` attr to migration files ([#470])
  • feat: support class var config ([#474])
  • feat: auto add aerich.models ([#476])
  • feat: add `load_tortoise_config` function ([#489])
  • refactor: use dataclass instead of pydantic for inspectdb ([#466])
  • refactor: use `ctx.with_async_resource` instead of magic patch `Context.__aexit__` ([#488])
  • feat: migrate from poetry to uv ([#481])
  • + 10 more
v0.9.1
waketzhengwaketzheng·1y ago·June 16, 2025
GitHub

🐛 Fixed

  • fix: `Command.migrate()` programmatically raises KeyError ([#462])
  • fix: `aerich init` removed comments in toml file ([#461])
  • fix: cryptic error message when 'aerich.models' not included. ([#454])
  • [#462]: https://github.com/tortoise/aerich/pull/462
  • [#461]: https://github.com/tortoise/aerich/pull/461
  • [#454]: https://github.com/tortoise/aerich/pull/454
v0.9.0
waketzhengwaketzheng·1y ago·May 14, 2025
GitHub

📋 Changes

  • Support `--no-input` for aerich migrate. ([#450])

📋 Changed

  • Drop support for Python3.8. ([#446])
  • Ask confirm before delete same version migration file. ([#451])
  • fix: m2m migrate raises TypeError. ([#448])
  • fix: `aerich init-db` process is suspended. ([#435])
  • fix: migration will incorrectly remove constraints with index deletions. ([#450])
  • fix: aerich migrate crashes without init-db & aerich init-db should create folder after validating app. ([#443])
  • [#451]: https://github.com/tortoise/aerich/pull/451
  • [#450]: https://github.com/tortoise/aerich/pull/450
  • + 4 more
v0.8.2
waketzhengwaketzheng·1y ago·February 28, 2025
GitHub

Added

  • Support changes `max_length` or int type for primary key field. (#428)
  • feat: support psycopg. (#425)
  • Support run `poetry add aerich` in project that inited by poetry v2. (#424)
  • feat: support command `python -m aerich`. (#417)
  • feat: add --fake to upgrade/downgrade. (#398)
  • Support ignore table by settings `managed=False` in `Meta` class. (#397)

🐛 Fixed

  • fix: aerich migrate raises tortoise.exceptions.FieldError when `index.INDEX_TYPE` is not empty. (#415)
  • No migration occurs as expected when adding `unique=True` to indexed field. (#404)
  • fix: inspectdb raise KeyError 'int2' for smallint. (#401)
  • fix: inspectdb not match data type 'DOUBLE' and 'CHAR' for MySQL. (#187)

📋 Changed

  • Refactored version management to use `importlib.metadata.version(__package__)` instead of hardcoded version string (#412)

New Contributors

  • @Abdeldjalil-H made their first contribution in https://github.com/tortoise/aerich/pull/412
  • @alistairmaclean made their first contribution in https://github.com/tortoise/aerich/pull/413
  • @radluz made their first contribution in https://github.com/tortoise/aerich/pull/251
  • @ProgrammerPlus1998 made their first contribution in https://github.com/tortoise/aerich/pull/187
  • Full Changelog: https://github.com/tortoise/aerich/compare/v0.8.1...v0.8.2
v0.8.1
waketzhengwaketzheng·1y ago·December 27, 2024
GitHub

📋 Changed

  • Move `tomlkit` to optional and support `pip install aerich[toml]`. ([#392])
  • Add version constraint(>=0.21) for tortoise-orm. ([#388])
  • Allow run `aerich init-db` with empty migration directories instead of abort with warnings. ([#286])

🐛 Fixed

  • fix: add o2o field does not create constraint when migrating. ([#396])
  • Migration with duplicate renaming of columns in some cases. ([#395])
  • fix: intermediate table for m2m relation not created. ([#394])
  • Migrate add m2m field with custom through generate duplicated table. ([#393])
  • Migrate drop the wrong m2m field when model have multi m2m fields. ([#376])
  • KeyError raised when removing or renaming an existing model. ([#386])
  • fix: error when there is `__init__.py` in the migration folder. ([#272])
  • Setting null=false on m2m field causes migration to fail. ([#334])
  • + 22 more
v0.8.0
waketzhengwaketzheng·1y ago·December 3, 2024
GitHub

📋 Changes

  • Fix the issue of parameter concatenation when generating ORM with inspectdb (#331)
  • Fix KeyError when deleting a field with unqiue=True. (#364)
  • Correct the click import. (#360)
  • Improve CLI help text and output. (#355)
  • Fix mysql drop unique index raises OperationalError. (#346)
v0.7.2
long2icelong2ice·2y ago·July 20, 2023
GitHub

📋 Changes

  • Support virtual fields.
  • Fix modify multiple times. (#279)
  • Added `-i` and `--in-transaction` options to `aerich migrate` command. (#296)
  • Fix generates two semicolons in a row. (#301)
v0.7.1
long2icelong2ice·3y ago·September 27, 2022
GitHub

📋 Changes

  • Fix syntax error with python3.8.10. (#265)
  • Fix sql generate error. (#263)
  • Fix initialize an empty database. (#267)
v0.7.1rc1Pre-release
long2icelong2ice·3y ago·September 23, 2022
GitHub

📋 Changes

  • Fix postgres sql error (#263)
v0.7.0
long2icelong2ice·3y ago·September 23, 2022
GitHub

📋 Changes

  • Improve `inspectdb` adding support to `postgresql::numeric` data type
  • Add support for dynamically load DDL classes easing to add support to
  • Fix decimal field change. (#246)
  • Support add/remove field with index.
v0.6.3
long2icelong2ice·4y ago·April 5, 2022
GitHub

📋 Changes

  • Improve `inspectdb` and support `postgres` & `sqlite`.
v0.6.2
long2icelong2ice·4y ago·January 17, 2022
GitHub

📋 Changes

  • Support migration for specified index. (#203)
v0.6.1
long2icelong2ice·4y ago·December 20, 2021
GitHub

📋 Changes

  • Fix `pyproject.toml` not existing error. (#217)
v0.6.0
long2icelong2ice·4y ago·December 8, 2021
GitHub

📋 Changes

  • Breaking change: Change default config file from `aerich.ini` to `pyproject.toml`. (#197)
  • Remove `pydantic` dependency. (#198)
  • `inspectdb` support `DATE`. (#215)
v0.5.8
long2icelong2ice·4y ago·September 1, 2021
GitHub

📋 Changes

  • Support `indexes` change. (#193)
v0.5.7
long2icelong2ice·4y ago·August 17, 2021
GitHub

📋 Changes

  • Fix no module found error. (#188) (#189)
v0.5.6
long2icelong2ice·4y ago·August 12, 2021
GitHub

📋 Changes

  • Add `Command` class. (#148) (#141) (#123) (#106)
  • Fix: migrate doesn't use source_field in unique_together. (#181)
v0.5.5
long2icelong2ice·4y ago·July 26, 2021
GitHub

📋 Changes

  • Fix KeyError: 'src_folder' after upgrading aerich to 0.5.4. (#176)
  • Fix MySQL 5.X rename column.
  • Fix `db_constraint` when fk changed. (#179)
v0.5.4v.0.5.4
long2icelong2ice·4y ago·July 7, 2021
GitHub

📋 Changes

  • Fix incorrect index creation order. (#151)
  • Not catch exception when import config. (#164)
  • Support `drop column` for sqlite. (#40)
v0.5.3
long2icelong2ice·5y ago·April 9, 2021
GitHub

📋 Changes

  • Fix postgre alter null. (#142)
  • Fix default function when migrate. (#147)
v0.5.2
long2icelong2ice·5y ago·March 25, 2021
GitHub

📋 Changes

  • Fix rename field on the field add. (#134)
  • Fix postgres field type change error. (#135)
  • Fix inspectdb for `FloatField`. (#138)
  • Support `rename table`. (#139)
v0.5.1
long2icelong2ice·5y ago·March 18, 2021
GitHub

📋 Changes

  • Fix tortoise connections not being closed properly. (#120)
  • Fix bug for field change. (#119)
  • Fix drop model in the downgrade. (#132)
v0.5.0
long2icelong2ice·5y ago·February 4, 2021
GitHub

📋 Changes

  • Refactor core code, now has no limitation for everything.
v0.4.4
long2icelong2ice·5y ago·January 22, 2021
GitHub

📋 Changes

  • Fix unnecessary import. (#113)
v0.4.3
long2icelong2ice·5y ago·December 25, 2020
GitHub

📋 Changes

  • Replace migrations separator to sql standard comment. (Should manual update previous version files)
  • Add `inspectdb` command.
v0.4.2
long2icelong2ice·5y ago·December 2, 2020
GitHub

📋 Changes

  • Use `.sql` instead of `.json` to store version file.
  • Add `rename` column support MySQL5.
  • Remove callable detection for defaults. (#87)
  • Fix `sqlite` stuck. (#90)
v0.4.1
long2icelong2ice·5y ago·November 28, 2020
GitHub

📋 Changes

  • Bug fix. (#91 #93 )
v0.4.0
long2icelong2ice·5y ago·November 26, 2020
GitHub

📋 Changes

  • Use `.sql` instead of `.json` to store version file.
  • Add `rename` column support MySQL5.
  • Remove callable detection for defaults. (#87)
  • Fix `sqlite` stuck. (#90)
v0.3.3
long2icelong2ice·5y ago·November 8, 2020
GitHub

📋 Changes

  • Fix encoding error. (#75)
  • Support multiple databases. (#68)
  • Compatible with models file in directory. (#70)
v0.3.2
long2icelong2ice·5y ago·October 16, 2020
GitHub

📋 Changes

  • Fix migrate to new database error. (#62)