* feat: support `--fake` for aerich upgrade
* Add `--fake` to downgrade
* tests: check --fake result for aerich upgrade and downgrade
* Update readme
* Fix unittest failed because of `db_field_types` changed
* refactor: improve type hints and document
* refactor: avoid updating config file if init config items not changed
* fix unittest error with tortoise develop branch
* Remove extra space
* fix mysql test error
* fix mysql create index error
* fix: migration with duplicate renaming of columns in some cases
* Update var name
* fix downgrade sql error
* fix test error
* docs: update changelog
* Add unittest
* Move not change line to origin position
* Update sort key to make it more frieldly interactive from multi fields rename
* refactor: remove puzzle vars
* docs: fix PR links in changelog
* fix sort key lambda error
* Add `__eq__` method for `Index`instances
* tests: add Index test case
* refactor: compare index instances before set hash and eq func to class
* fix: sort fields when generating index hash
* docs: update changlog
* fix style issue
* refactor: use CustomIndex instead of postgres special HashIndex
* Check tortoise version before patch Index
* Add comment
* Add comment for why > work
---------
Co-authored-by: dbf <somnium@riseup.net>
* fix: add o2o field does not create constraint when migrating
* Add testcase and update changelog
* docs: update migrating list
* refactor: use `_handle_o2o_fields` instead of `is_o2o=True`
* Remove unused line
* fix: migrate drop the wrong m2m field when model have multi m2m fields
* Make style and update changelog
* refactor: return new lists instead of change argument values in function
* refactor: use custom diff function instead of reorder lists
* docs: fix typo
* Fix hardcoded and rename custom diff function
* Update function doc
* fix: error when there is __init__.py in the migration folder
* fix: check __init__.py in the migration folder
* refactor
* refactor & add test
* refactor
* Update changelog
---------
Co-authored-by: Waket Zheng <waketzheng@gmail.com>
* fix: Fixed an issue where an error would occur when using aerich in windows if the profile contained Chinese characters
* fix: Automatically delete the empty migration directory of the app if the init-db operation fails
* feat: generate migration file in empty directory instead of abort with warning
* tests: fix test fail in ci
---------
Co-authored-by: Waket Zheng <waketzheng@gmail.com>
* Update add/drop index template for sqlite
* tests: add sqlite migrate/upgrade command test
* tests: add timeout for sqlite migrate command test
* tests: add test cases for add/drop unique field for sqlite
* fix: sqlite failed to add unique field
* 🐛 Sort m2m fields before comparing them with `diff(...)`
* Add test case and upgrade changelog
---------
Co-authored-by: Waket Zheng <waketzheng@gmail.com>
* Fix KeyError when deleting a field with unqiue=True
* refactor: rename `old_data_unique` to `is_unique_field`
* Add testcases for remove unique field
---------
Co-authored-by: gongchangku <gongchangku@anban.tech>
Co-authored-by: Waket Zheng <waketzheng@gmail.com>