summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorLily Acorn <code@lilyf.org>2025-11-20 20:10:13 +0000
committerJacob Walls <jacobtylerwalls@gmail.com>2025-12-12 11:50:36 -0500
commite95468ed97b1c250939da316218c39dad577ba32 (patch)
treec4059a0fa69e071b8d87d918cf01791d7f381af1 /docs/ref
parentaccceec9493d08e19d59fa1a59f69c0fdf23bb13 (diff)
Refs #36735 -- Supported shift parameter for UUID7 on PostgreSQL.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/database-functions.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index cf251a758d..fba7a53826 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -1901,7 +1901,7 @@ generated using a cryptographically secure method.
.. versionadded:: 6.1
-.. class:: UUID7()
+.. class:: UUID7(shift=None)
Generates a :rfc:`version 7 UUID <9562#section-5.7>`, which starts with a
time-based component.
@@ -1911,6 +1911,14 @@ time-based component.
Available on PostgreSQL version 18 or later, MariaDB version 11.7 or later,
and SQLite on Python version 3.14 or later.
+.. admonition:: ``shift``
+
+ On PostgreSQL, ``UUID7`` also supports an optional ``shift`` value, which
+ can be used to offset the timestamp of the generated UUID. This should be a
+ :class:`datetime.timedelta` or an expression with an ``output_field`` of
+ :class:`~django.db.models.DurationField`. A positive value will shift the
+ timestamp into the future and a negative value into the past.
+
Window functions
================