Skip to content

Commit

Permalink
Merge pull request #234 from amos402/migrate
Browse files Browse the repository at this point in the history
Allow custom MigrationNode for `build`
  • Loading branch information
roman-right committed Apr 1, 2022
2 parents c42b71b + 4d30586 commit cdabb3c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion beanie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from beanie.odm.utils.general import init_beanie
from beanie.odm.documents import Document

__version__ = "1.10.3"
__version__ = "1.10.4"
__all__ = [
# ODM
"Document",
Expand Down
4 changes: 2 additions & 2 deletions beanie/migrations/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async def build(cls, path: Path):
)
current_migration = await MigrationLog.find_one({"is_current": True})

root_migration_node = MigrationNode("root")
root_migration_node = cls("root")
prev_migration_node = root_migration_node

for name in names:
Expand All @@ -185,7 +185,7 @@ async def build(cls, path: Path):
).load_module((path / name).stem)
forward_class = getattr(module, "Forward", None)
backward_class = getattr(module, "Backward", None)
migration_node = MigrationNode(
migration_node = cls(
name=name,
prev_migration=prev_migration_node,
forward_class=forward_class,
Expand Down
19 changes: 16 additions & 3 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

Beanie project

## [1.10.2] - 2022-02-24
## [1.10.4] - 2022-02-24

### Improvement

- Allow custom MigrationNode for build

### Implementation

- Author - [amos402](https://github.com/amos402)
- PR <https://github.com/roman-right/beanie/pull/234>

## [1.10.3] - 2022-02-29

### Improvement

Expand All @@ -12,7 +23,7 @@ Beanie project

- ISSUE <https://github.com/roman-right/beanie/issues/225>

## [1.10.2] - 2022-02-24
## [1.10.2] - 2022-02-28

### Improvement

Expand Down Expand Up @@ -762,4 +773,6 @@ how specific type should be presented in the database

[1.10.2]: https://pypi.org/project/beanie/1.10.2

[1.10.3]: https://pypi.org/project/beanie/1.10.3
[1.10.3]: https://pypi.org/project/beanie/1.10.3

[1.10.4]: https://pypi.org/project/beanie/1.10.4
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "beanie"
version = "1.10.3"
version = "1.10.4"
description = "Asynchronous Python ODM for MongoDB"
authors = ["Roman <roman-right@protonmail.com>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_beanie.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "1.10.3"
assert __version__ == "1.10.4"

0 comments on commit cdabb3c

Please sign in to comment.