fix(deps): upgrade dependency tortoise-orm to v1 - #1
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
June 13, 2026 00:04
ed50257 to
8f7a133
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
July 25, 2026 12:10
8f7a133 to
2980712
Compare
renovate
Bot
force-pushed
the
renovate/tortoise-orm-1.x
branch
from
August 15, 2026 11:33
2980712 to
e898edb
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.0.0→>=1.1.8,<1.2.0Release 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 becomes conflicted, 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.