]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Revert automatic set of sequence start to 1
authorFederico Caselli <cfederico87@gmail.com>
Sat, 24 Sep 2022 13:50:26 +0000 (15:50 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 17 Oct 2022 19:36:25 +0000 (15:36 -0400)
commit974b1bd0fc40e11fc2886b5a9fc333feeeebf546
tree421f0545c13a203f40435c4646a0de664e0e9756
parent665c94cc2f0340735515c4f4477e11b556d2bcd8
Revert automatic set of sequence start to 1

The :class:`.Sequence` construct restores itself to the DDL behavior it
had prior to the 1.4 series, where creating a :class:`.Sequence` with
no additional arguments will emit a simple ``CREATE SEQUENCE`` instruction
**without** any additional parameters for "start value".   For most backends,
this is how things worked previously in any case; **however**, for
MS SQL Server, the default value on this database is
``-2**63``; to prevent this generally impractical default
from taking effect on SQL Server, the :paramref:`.Sequence.start` parameter
should be provided.   As usage of :class:`.Sequence` is unusual
for SQL Server which for many years has standardized on ``IDENTITY``,
it is hoped that this change has minimal impact.

Fixes: #7211
Change-Id: I1207ea10c8cb1528a1519a0fb3581d9621c27b31
36 files changed:
doc/build/changelog/migration_14.rst
doc/build/changelog/unreleased_20/7211.rst [new file with mode: 0644]
doc/build/changelog/whatsnew_20.rst
doc/build/core/defaults.rst
doc/build/orm/persistence_techniques.rst
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mssql/provision.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/testing/provision.py
lib/sqlalchemy/testing/suite/test_sequence.py
test/dialect/mssql/test_sequence.py
test/dialect/oracle/test_compiler.py
test/dialect/postgresql/test_compiler.py
test/engine/test_ddlevents.py
test/engine/test_execute.py
test/engine/test_reflection.py
test/ext/asyncio/test_session_py3k.py
test/orm/inheritance/test_assorted_poly.py
test/orm/inheritance/test_manytomany.py
test/orm/test_generative.py
test/orm/test_session.py
test/orm/test_unitofwork.py
test/orm/test_unitofworkv2.py
test/sql/test_compiler.py
test/sql/test_defaults.py
test/sql/test_deprecations.py
test/sql/test_functions.py
test/sql/test_insert.py
test/sql/test_insert_exec.py
test/sql/test_returning.py
test/sql/test_selectable.py
test/sql/test_sequences.py