Update dependency tortoise-orm to v1 - #307
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
6 times, most recently
from
February 17, 2026 16:53
25d751d to
f6d6049
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
February 19, 2026 22:10
f6d6049 to
7879829
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
3 times, most recently
from
March 5, 2026 09:29
0014655 to
21e8511
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
March 28, 2026 21:13
ced339b to
e3f57f2
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
April 1, 2026 22:10
8d5efa0 to
c851a46
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
April 9, 2026 01:53
c851a46 to
77c7e35
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
May 16, 2026 16:33
60d7034 to
a24c02a
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
4 times, most recently
from
June 8, 2026 00:42
3be273c to
3ea9460
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
June 11, 2026 07:06
649126b to
2136e26
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
June 18, 2026 03:01
1c27c4e to
18b351e
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
July 7, 2026 19:32
f894e06 to
5e76004
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
July 17, 2026 20:52
fa95d14 to
0c53f7b
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
4 times, most recently
from
July 27, 2026 19:43
9762a20 to
6484704
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
2 times, most recently
from
August 10, 2026 14:09
6aa7de1 to
c2518cf
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
August 25, 2026 20:36
c2518cf to
4d2815c
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
September 5, 2026 13:43
4d2815c to
4b3d997
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==0.25.4→==1.1.8Release Notes
tortoise/tortoise-orm (tortoise-orm)
v1.1.8Compare Source
Added
^^^^^
QuerySet.union()— SQL UNION query support for combining results from multiple QuerySets, including support for union across different models,union(all=True)for duplicates,order_by(),limit(), andcount(). (#2146)postgresql://scheme as alias for asyncpg (#2154)QuerySet.contains()method to check if an object exists in a queryset. (#2163)DomainNameValidator,URLValidator, andEmailValidatorclasses for common validation patterns. (#2167)Fixed
^^^^^
MigrationRecordernow uses parameterized queries; fixes MariaDB/MySQL rejecting ISO-8601applied_atvalues. (#2132)db_defaultonForeignKeyField/OneToOneFieldnow propagates to the underlying<fk>_idcolumn, soCREATE TABLEemits theDEFAULTclause for FK columns. (#2199)db_defaulton FK/O2O dropped during_init_relations(#2200)MigrationRecorderno longer emits tortoise's ownpkfieldDeprecationWarningwhen applying migrations; it now builds its bookkeeping model withprimary_key=True. (#2203)QuerySet.count()now matches the limited query result for the LIMIT/OFFSET edge cases: it returns0(instead of a negative number) whenoffset()exceeds the total row count, and0(instead of the total) forlimit(0). (#2208)CharField[str]) in Pyright/Pylance instead ofField[Unknown]; theField.__new__type-check stub now returnsSelf. (#2216)TransactionContextnow returns aTransactionalDBClientinstead of a raw database connection. This change gives the correct inferred type for the transaction context. (#2232)v1.1.7Compare Source
Added
^^^^^
QuerySet.union()— SQL UNION query support for combining results from multiple QuerySets, including support for union across different models,union(all=True)for duplicates,order_by(),limit(), andcount().Fixed
^^^^^
db_defaulton create instead ofNone. (#2143)db_defaulthandling for MySQL. (#2142)Changed
^^^^^^^
v1.1.6Compare Source
Fixed
^^^^^
AddIndex,RemoveIndex,AddConstraint,RemoveConstraintoperations when adding/removing a field to a model that is used in an index or constraint. (#2118)CreateModelmigrations now includeDEFAULTclauses for fields withdb_defaultset. Previously onlyAddFieldemitted defaults correctly. (#2129)AlterFieldmigrations now detectmax_lengthchanges (e.g.VARCHAR(32)→VARCHAR(64)) and emit the correctALTERstatements across all backends. (#2128)backward_relations=FalseinPydanticMetanow only excludes unannotated backward relations — fields explicitly annotated withReverseRelationin the model class body are preserved. (#2125)time_zonenow uses the configured timezone instead of always defaulting to+0:00whenuse_tz=True. (#2127)+) in database URL passwords is no longer incorrectly decoded as a space. (#2123)v1.1.5Compare Source
Fixed
^^^^^
makemigrationsno longer crashes withAttributeError: 'tuple' object has no attribute 'deconstruct'when generating a freshCreateModelmigration for models using tuple-styleMeta.indexes(e.g.indexes = [("field_a", "field_b")]). Tuple entries are now normalised toIndexobjects before rendering.v1.1.4Compare Source
Added
^^^^^
CheckConstraintsupport inMeta.constraints— named check constraints are now captured by the migration autodetector, enablingAddConstraint/RemoveConstraint/RenameConstraintgeneration viamakemigrations.UniqueConstraint.conditionparameter for partial unique indexes on PostgreSQL (emitted asCREATE UNIQUE INDEX ... WHERE).Fixed
^^^^^
organizationare now correctly resolved to their DB column (e.g.organization_id) inadd_constraint,remove_constraint, andrename_constraintacross all backends.HASHBYTESexpression default —RandomHexnow wrapsNEWID()withCAST(... AS NVARCHAR(36))to avoid implicit conversion error.ALTER COLUMN SET DEFAULTtemplate now wraps expression defaults in parentheses.RenameConstraintoperation now preserves constraint type and fields during forward/backward migrations._create_missing_fk_index) prevents MySQL error 1553 when dropping the only index covering a foreign key column.ADD COLUMNwith non-deterministicSqlDefaultexpressions (e.g.RANDOM_BYTES).v1.1.3Compare Source
Added
^^^^^
RandomHexdialect-awareSqlDefaultsubclass for generating random hex strings across all backends. (#2108)Meta.constraintssupport on models — namedUniqueConstraintobjects are now captured by the migration autodetector, enablingAddConstraint/RemoveConstraintgeneration viamakemigrations. (#2108)_alter_fieldoverride usingMODIFY COLUMNfor NULL/NOT NULL changes; backtick-quotedALTER_FIELD_*templates. (#2108)_alter_fieldoverride withALTER COLUMNfor nullability, named default constraint management viasys.default_constraints, bracket-quoted templates, and self-referencing FK CASCADE → NO ACTION downgrade. (#2108)Fixed
^^^^^
ALTER COLUMN ... SET NOT NULL/DROP NOT NULLnow correctly emitsMODIFY COLUMN col type NOT NULL/NULL. (#2108)DELETE_CONSTRAINT_TEMPLATEandUNIQUE_CONSTRAINT_CREATE_TEMPLATEnow use bracket quoting[name]instead of double quotes. (#2108)CASCADEno longer fail with error 1785; automatically downgraded toNO ACTION. (#2108)v1.1.2Compare Source
Fixed
^^^^^
v1.1.1Compare Source
Added
^^^^^
SqlDefaultandNowexpressions fordb_default— usedb_default=SqlDefault("...")to emit raw SQL expressions (e.g.CURRENT_TIMESTAMP) as database defaults.Now()is a convenience shorthand forSqlDefault("CURRENT_TIMESTAMP"). (#2104)Changed
^^^^^^^
Field(default=...)andauto_now/auto_now_addno longer emits aDEFAULTclause ingenerate_schemas(). Thedefaultparameter is Python-only; usedb_defaultfor database-level defaults. This alignsgenerate_schemas()with migrations, which don't emittedDEFAULTfordefault=. (#2104)v1.1.0Compare Source
Added
^^^^^
db_defaultparameter for fields — set database-levelDEFAULTclauses that propagate to schema generation and migrations. Unlikedefault(Python-only),db_defaultis persisted in the DB schema and applied even for rows inserted outside the ORM. (#2101)Model.construct()classmethod for building model instances without field validation — useful in test factories and fixtures. (#2099)truncate_all_models()now respects foreign key constraints using topological ordering (SQLite/MySQL) orTRUNCATE ... CASCADE(PostgreSQL). (#2100)Fixed
^^^^^
Noneassignment to nullable fields. (#2089)set global fallback defaultin Sanicregister_tortoise. (#2090)[]for db url parsing. (#2081) (#2092)UnicodeEncodeErrorby using UTF-8 encoding for migration files. (#2096, #2097)v1.0.0Compare Source
.. warning::
Breaking Changes
^^^^^^^^^^^^^^^^
use_tznow defaults toTrue(wasFalse). Setuse_tz=Falseexplicitly if you need naive datetimes.TortoiseContextinstances.Tortoise.init()returns aTortoiseContext(previously returnedNone). Multiple separateasyncio.run()calls require explicit context management; the typical singleasyncio.run(main())pattern works unchanged.test.TestCase,test.IsolatedTestCase,test.TruncationTestCase,test.SimpleTestCase,initializer(),finalizer(),env_initializer(),getDBConfig(). Usetortoise_test_context()with pytest instead.pytzdependency: Timezone handling now uses the standard libraryzoneinfomodule. Tortoise APIs returnZoneInfoobjects instead ofpytztimezones. (#2023)DatetimeField/TimeFieldwithauto_now=Trueno longer implicitly setsauto_now_add=True. In practiceauto_now=Truealone still sets the value on every save (including creation), so this is unlikely to affect most users. The internal flag coupling was removed for correctness.pip install tortoise-orm[ipython]orpip install tortoise-orm[ptpython].Added
^^^^^
tortoise makemigrations,tortoise migrate,tortoise sqlmigrate. SupportsRunPython,RunSQL, reversible migrations, and multi-app projects. (#2061)warehouse.inventory), with cross-schema relations and migration support. (#2084)TSVectorField,SearchVector,SearchQuery,SearchRank,SearchHeadlineexpressions, and GIN/GiST index support. (#2065)tortoise.query_api) for building and executing custom pypika queries against models, withModel.get_table()classmethod. (#2064)TortoiseContext— explicit context manager for ORM state with full isolation. (#2069)tortoise_test_context()— modern pytest fixture helper for test isolation. (#2069)get_connection(alias)/get_connections()— functions to access connections from current context.Tortoise.close_connections()— restored (was deprecated in 0.19) as the canonical way to close connections, now context-aware.Tortoise.is_inited()— explicit method version ofTortoise._initedproperty.ForeignKeyFieldandManyToManyFieldnow accept a model class directly, not just string references. (#2027)DateFieldnow supports__year/__month/__dayfilters. (#2067)Changed
^^^^^^^
Tortoise.close_connections()internally.ConnectionHandleruses per-instance ContextVar storage for context isolation.Tortoise.appsandTortoise._initedare nowclasspropertydescriptors.Deprecated
^^^^^^^^^^
from tortoise import connections— useget_connection()/get_connections()instead (still works but deprecated).Fixed
^^^^^
use_tz=Falsenow correctly preserves naive datetimes instead of silently making them timezone-aware. (#631)ValuesListQuerywhen not specified in.values_list()fields. (#2059)Optional. (#2082)Model.in_bulktype annotation now supports any primary key type. (#2075)sqlmigratecommand added. (#2076)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.