feat: support virtual fields

This commit is contained in:
long2ice 2022-11-18 23:23:04 +08:00
parent 90943a473c
commit 52b50a2161
3 changed files with 27 additions and 21 deletions

View File

@ -2,6 +2,10 @@
## 0.7 ## 0.7
### 0.7.2
- Support virtual fields.
### 0.7.1 ### 0.7.1
- Fix syntax error with python3.8.10. (#265) - Fix syntax error with python3.8.10. (#265)

View File

@ -281,8 +281,10 @@ class Migrate:
# remove indexes # remove indexes
for index in old_indexes.difference(new_indexes): for index in old_indexes.difference(new_indexes):
cls._add_operator(cls._drop_index(model, index, False), upgrade, True) cls._add_operator(cls._drop_index(model, index, False), upgrade, True)
old_data_fields = old_model_describe.get("data_fields") old_data_fields = list(filter(lambda x: x.get('db_field_types') is not None,
new_data_fields = new_model_describe.get("data_fields") old_model_describe.get("data_fields")))
new_data_fields = list(filter(lambda x: x.get('db_field_types') is not None,
new_model_describe.get("data_fields")))
old_data_fields_name = list(map(lambda x: x.get("name"), old_data_fields)) old_data_fields_name = list(map(lambda x: x.get("name"), old_data_fields))
new_data_fields_name = list(map(lambda x: x.get("name"), new_data_fields)) new_data_fields_name = list(map(lambda x: x.get("name"), new_data_fields))

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "aerich" name = "aerich"
version = "0.7.1" version = "0.7.2"
description = "A database migrations tool for Tortoise ORM." description = "A database migrations tool for Tortoise ORM."
authors = ["long2ice <long2ice@gmail.com>"] authors = ["long2ice <long2ice@gmail.com>"]
license = "Apache-2.0" license = "Apache-2.0"