Waket Zheng
f93faa8afb
fix: add o2o field does not create constraint when migrating ( #396 )
...
* 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
2024-12-22 00:23:47 +08:00
Waket Zheng
69ce0cafa1
fix: intermediate table for m2m relation not created ( #394 )
...
* fix: intermediate table for m2m relation not created
* Add unittest
* docs: update changelog
2024-12-18 00:13:19 +08:00
Waket Zheng
4fc7f324d4
fix: add m2m field with custom m2m through generate duplicated table when migrating ( #393 )
...
* fix: m2m table duplicated when using custom model for through
* Add testcase
* docs: update changelog
* tests: add m2m custom through example test
2024-12-17 22:28:06 +08:00
Waket Zheng
0780919ef3
fix: migrate drop the wrong m2m field when model have multi m2m fields ( #390 )
...
* 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
2024-12-17 01:20:02 +08:00
Lance.Moe
6270c4781e
fix: error when there is __init__.py in the migration folder ( #272 )
...
* 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>
2024-12-11 21:34:14 +08:00
Waket Zheng
12d0a5dad1
fix: setting null=false on m2m field causes migration to fail ( #385 )
...
* fix: setting null=false on m2m field causes migration to fail
* Update changelog
2024-12-11 21:12:04 +08:00
Waket Zheng
e4a3863f80
fix: aerich upgrade
raises OperationalError when unique constraint dropped at migration 1_xxx.py with postgres ( #383 )
2024-12-11 15:15:29 +08:00
Waket Zheng
5572876714
fix: NonExistentKey when running aerich init
without [tool]
section in config file ( #381 )
...
* fix: NonExistentKey when running `aerich init` without `[tool]` section in config file
* docs: update changelog
2024-12-11 13:26:18 +08:00
Tuffy_
accceef24f
Fixed two problems when using under windows ( #286 )
...
* 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>
2024-12-10 23:02:49 +08:00
Waket Zheng
9c81bc6036
Fix sqlite create/drop index ( #379 )
...
* 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
2024-12-10 16:37:30 +08:00
Waket Zheng
c2ebe9b5e4
Fix postgres fk rename ( #378 )
...
* Update postgres drop fk template
* fix test error
* docs: update changlog
2024-12-09 11:41:40 +08:00
Mykola Solodukha
8cefe68c9b
[BUG] Sort m2m fields before comparing them with diff(...)
( #271 )
...
* 🐛 Sort m2m fields before comparing them with `diff(...)`
* Add test case and upgrade changelog
---------
Co-authored-by: Waket Zheng <waketzheng@gmail.com>
2024-12-05 17:41:58 +08:00
Waket Zheng
44025823ee
chore: upgrade deps and fix ruff lint issues ( #374 )
...
* chore: upgrade deps and apply ruff lint for tests/
* style: fix ruff lint issues
2024-12-05 15:56:00 +08:00
Waket Zheng
ac3ef9e2eb
tests: no need to merge operators when NotSupportError raised ( #373 )
2024-12-03 23:59:54 +08:00
Waket Zheng
5b04b4422d
chore: upgrade deps, update changelog, drop test db before create ( #372 )
...
* chore: upgrade deps, update changelog, drop test db before create
* tests: clear operators for sqlite ddl after NotSupportError raised
2024-12-03 23:30:37 +08:00
gck123
c0fd3ec63c
Fix KeyError when deleting a field with unqiue=True ( #365 )
...
* 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>
2024-12-03 10:16:44 +08:00
Waket Zheng
dc020358b6
chore: make style, upgrade deps, fix ci error and update changelog
2024-11-25 23:46:48 +08:00
long2ice
15d56121ef
fix: migrate
2024-08-06 22:46:50 +08:00
Waket Zheng
bceeb236c2
Checking cache action
2024-06-06 17:21:46 +08:00
Waket Zheng
ceb1e0ffef
Activate type hint check in ci
2024-06-06 17:07:09 +08:00
Waket Zheng
7b733495fb
fix conflict
2024-06-06 16:35:09 +08:00
long2ice
f3b6f8f264
Merge pull request #345 from waketzheng/dev
...
Drop python3.7 support
2024-06-06 15:49:31 +08:00
Waket Zheng
e764bb56f7
Add new column for unique index remove test
2024-06-06 09:07:13 +08:00
Waket Zheng
e971653851
fix: mysql drop unique index migrate error
2024-06-05 23:37:30 +08:00
Waket Zheng
58d31b3a05
fix: make ci error with latest tortoise-orm ( #344 )
2024-06-04 01:44:28 +08:00
Waket Zheng
1addda8178
Improve type hints for tests/
2024-06-01 20:58:25 +08:00
long2ice
b63fbcc7a4
style: fix
2024-01-18 09:50:41 +08:00
ar0ne
ad54b5e9dd
remove redundant comma for empty migration
2023-12-26 23:12:11 +05:30
ar0ne
b1ff2418f5
added option to generate empty migration file
2023-12-26 22:55:51 +05:30
long2ice
8cf50c58d7
test: fix ci
2023-01-27 15:17:41 +08:00
long2ice
ab31445fb2
fix: test
2022-09-26 18:39:48 +08:00
long2ice
28d19a4b7b
- Fix syntax error with python3.8.10. ( #265 )
...
- Fix sql generate error. (#263 )
2022-09-26 18:36:57 +08:00
long2ice
75db7cea60
fix: test error
2022-09-23 10:35:33 +08:00
long2ice
d777c9c278
Merge remote-tracking branch 'origin/dev' into dev
...
# Conflicts:
# aerich/utils.py
# tests/test_utils.py
2022-09-23 10:30:46 +08:00
long2ice
e9b76bdd35
feat: use .py version files
2022-09-23 10:29:48 +08:00
KDH
7b472d7a84
Fix testcase
2022-09-16 10:08:34 +09:00
KDH
1f0a6dfb50
Fix typo
2022-09-16 09:58:04 +09:00
KDH
36282f123f
Merge branch 'dev' into fix-ddl-format-and-writing-version-file
...
# Conflicts:
# aerich/utils.py
# tests/test_migrate.py
2022-09-16 09:54:51 +09:00
Yasser Tahiri
131d97a3d6
Merge branch 'dev' into dev
2022-09-15 23:19:59 +01:00
long2ice
d6627906c7
test: fix test_migrate
2022-06-27 11:36:09 +08:00
long2ice
3c88833154
fix: decimal field change ( #246 )
2022-06-27 11:29:47 +08:00
Isaque Alves
db33059ec9
Resolve style issue
2022-06-20 15:42:21 -03:00
Isaque Alves
44b96058f8
fix(tests/test_migrate.py): Resolve issue with broken tests
2022-06-17 12:36:04 -03:00
Isaque Alves
abff753b6a
refactor: Improve postgresql migrate operators tests
2022-06-17 09:45:02 -03:00
Yasser Tahiri
40c7ef7fd6
Merge repeated if
statements into single if
2021-10-21 15:43:18 +01:00
KDH
7a826df43f
Fix duplicated semicolon in table creation DDL
2021-10-12 11:24:37 +09:00
KDH
b1b9cc1454
Fix M2M table template
2021-10-12 11:23:29 +09:00
long2ice
01787558d6
Fix test
2021-08-31 17:41:13 +08:00
long2ice
699b0321a4
Support indexes
change. ( #193 )
2021-08-31 17:36:25 +08:00
Vovetta
aa9f40ae27
Fix: migrate doesn't use source_field in unique_together
2021-08-03 10:36:06 -07:00