Skip to content

Commit f9e34b8

Browse files
committed
Bump 1.1.6
1 parent 3eafeb5 commit f9e34b8

2 files changed

Lines changed: 31 additions & 26 deletions

File tree

CHANGELOG.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ Changelog
1313

1414
Fixed
1515
^^^^^
16-
- Migration generator now correctly orders ``AddIndex``, ``RemoveIndex``, ``AddConstraint``, ``RemoveConstraint`` operatins when adding/removing a field to a model and is used in an index or constraint.
16+
- Migration generator now correctly orders ``AddIndex``, ``RemoveIndex``, ``AddConstraint``, ``RemoveConstraint`` operations when adding/removing a field to a model that is used in an index or constraint. (#2118)
17+
- ``CreateModel`` migrations now include ``DEFAULT`` clauses for fields with ``db_default`` set. Previously only ``AddField`` emitted defaults correctly. (#2129)
18+
- ``AlterField`` migrations now detect ``max_length`` changes (e.g. ``VARCHAR(32)`` → ``VARCHAR(64)``) and emit the correct ``ALTER`` statements across all backends. (#2128)
19+
- ``backward_relations=False`` in ``PydanticMeta`` now only excludes unannotated backward relations — fields explicitly annotated with ``ReverseRelation`` in the model class body are preserved. (#2125)
20+
- MySQL session ``time_zone`` now uses the configured timezone instead of always defaulting to ``+0:00`` when ``use_tz=True``. (#2127)
21+
- Plus sign (``+``) in database URL passwords is no longer incorrectly decoded as a space. (#2123)
1722

1823
1.1.5
1924
-----

tortoise/__init__.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_connection(cls, connection_name: str) -> BaseDBAsyncClient:
144144

145145
@classmethod
146146
def describe_model(
147-
cls, model: type[Model], serializable: bool = True
147+
cls, model: type[Model], serializable: bool = True
148148
) -> dict[str, Any]: # pragma: nocoverage
149149
"""
150150
Describes the given list of models or ALL registered models.
@@ -170,7 +170,7 @@ def describe_model(
170170

171171
@classmethod
172172
def describe_models(
173-
cls, models: list[type[Model]] | None = None, serializable: bool = True
173+
cls, models: list[type[Model]] | None = None, serializable: bool = True
174174
) -> dict[str, dict[str, Any]]:
175175
"""
176176
Describes the given list of models or ALL registered models.
@@ -211,10 +211,10 @@ def _init_relations(cls) -> None:
211211

212212
@classmethod
213213
def init_models(
214-
cls,
215-
models_paths: Iterable[ModuleType | str],
216-
app_label: str,
217-
_init_relations: bool = True,
214+
cls,
215+
models_paths: Iterable[ModuleType | str],
216+
app_label: str,
217+
_init_relations: bool = True,
218218
) -> None:
219219
"""
220220
Early initialisation of Tortoise ORM Models.
@@ -232,10 +232,10 @@ def init_models(
232232

233233
@classmethod
234234
def init_app(
235-
cls,
236-
label: str,
237-
model_paths: Iterable[ModuleType | str],
238-
_init_relations: bool = True,
235+
cls,
236+
label: str,
237+
model_paths: Iterable[ModuleType | str],
238+
_init_relations: bool = True,
239239
) -> dict[str, type[Model]]:
240240
"""
241241
Early initialization of Tortoise ORM Models for a single app.
@@ -260,7 +260,7 @@ def init_app(
260260

261261
@classmethod
262262
def _init_apps(
263-
cls, apps_config: dict[str, dict[str, Any]], *, validate_connections: bool = True
263+
cls, apps_config: dict[str, dict[str, Any]], *, validate_connections: bool = True
264264
) -> None:
265265
"""Internal: Initialize Apps registry on current context."""
266266
ctx = cls._require_context()
@@ -295,18 +295,18 @@ def _build_initial_querysets(cls) -> None:
295295

296296
@classmethod
297297
async def init(
298-
cls,
299-
config: dict[str, Any] | TortoiseConfig | None = None,
300-
config_file: str | None = None,
301-
_create_db: bool = False,
302-
db_url: str | None = None,
303-
modules: dict[str, Iterable[str | ModuleType]] | None = None,
304-
use_tz: bool = True,
305-
timezone: str = "UTC",
306-
routers: list[str | type] | None = None,
307-
table_name_generator: Callable[[type[Model]], str] | None = None,
308-
init_connections: bool = True,
309-
_enable_global_fallback: bool = False,
298+
cls,
299+
config: dict[str, Any] | TortoiseConfig | None = None,
300+
config_file: str | None = None,
301+
_create_db: bool = False,
302+
db_url: str | None = None,
303+
modules: dict[str, Iterable[str | ModuleType]] | None = None,
304+
use_tz: bool = True,
305+
timezone: str = "UTC",
306+
routers: list[str | type] | None = None,
307+
table_name_generator: Callable[[type[Model]], str] | None = None,
308+
init_connections: bool = True,
309+
_enable_global_fallback: bool = False,
310310
) -> TortoiseContext:
311311
"""
312312
Sets up Tortoise-ORM: loads apps and models, configures database connections but does not
@@ -459,7 +459,7 @@ def star_password(connections_config) -> str:
459459
str_connection_config = str_connection_config.replace(
460460
password,
461461
# Show one third of the password at beginning (may be better for debugging purposes)
462-
f"{password[0 : len(password) // 3]}***",
462+
f"{password[0: len(password) // 3]}***",
463463
)
464464
return str_connection_config
465465

@@ -585,7 +585,7 @@ async def main() -> None:
585585
portal.call(main)
586586

587587

588-
__version__ = "1.1.5"
588+
__version__ = "1.1.6"
589589

590590
__all__ = [
591591
"BackwardFKRelation",

0 commit comments

Comments
 (0)