]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
2 months agouse pathlib for file operations across the board
Mike Bayer [Mon, 19 May 2025 17:06:56 +0000 (13:06 -0400)] 
use pathlib for file operations across the board

The command, config and script modules now rely on ``pathlib.Path`` for
internal path manipulations, instead of ``os.path()`` operations.   Public
API functions that accept string directories and filenames continue to do
so but also accept ``os.PathLike`` objects.  Public API functions and
accessors that return paths as strings continue to do so.   Private API
functions and accessors, i.e. all those that are prefixed with an
underscore, may now return a Path object rather than a string to indicate
file paths.

Change-Id: I7c79cdecd7e866c7086422079aa92077816acec3

2 months agoremove py 3.10 from github pep 484 action
Mike Bayer [Mon, 19 May 2025 16:30:37 +0000 (12:30 -0400)] 
remove py 3.10 from github pep 484 action

tomllib isn't present

Change-Id: I942b6b4fbbb85663a35e9373bb33ca92651070fb

2 months agoMerge "allow pep 621 configuration" into main
Michael Bayer [Mon, 19 May 2025 16:16:01 +0000 (16:16 +0000)] 
Merge "allow pep 621 configuration" into main

2 months agoMerge "Add file_path_separator to apply to all path splitting" into main
Michael Bayer [Mon, 19 May 2025 16:15:52 +0000 (16:15 +0000)] 
Merge "Add file_path_separator to apply to all path splitting" into main

2 months agoAdd support of IF [NOT] EXISTS for ADD/DROP COLUMN in Postgresql
Louis-Amaury Chaib [Mon, 19 May 2025 13:11:00 +0000 (09:11 -0400)] 
Add support of IF [NOT] EXISTS for ADD/DROP COLUMN in Postgresql

Added :paramref:`.Operations.add_column.if_not_exists` and
:paramref:`.Operations.drop_column.if_exists` to render ``IF [NOT] EXISTS``
for ``ADD COLUMN`` and ``DROP COLUMN`` operations, a feature available on
some database backends such as PostgreSQL, MariaDB, as well as third party
backends.  The parameters also support autogenerate rendering allowing them
to be turned on via a custom :class:`.Rewriter`. Pull request courtesy of
Louis-Amaury Chaib (@lachaib).

Fixes: #1626
Closes: #1627
Pull-request: https://github.com/sqlalchemy/alembic/pull/1627
Pull-request-sha: c503b049f453a12e7fdb87464606cddd58ad306c

Change-Id: I4d55f65f072b9f03698b2f45f066872b5c3e8c58

2 months agoallow pep 621 configuration
Mike Bayer [Tue, 13 May 2025 14:14:10 +0000 (10:14 -0400)] 
allow pep 621 configuration

Added optional :pep:`621` support to Alembic, where a subset of the
project-centric configuration normally found in the ``alembic.ini`` file
can now be retrieved from the project-wide ``pyproject.toml`` file.   A new
init template ``pyproject`` is added which illustrates a basic :pep:`621`
setup.  The :pep:`621` feature supports configuration values that are
relevant to code locations and code production only; it does not
accommodate database connectivity, configuration, or logging configuration.
These latter configurational elements remain as elements that can be
present either in the ``alembic.ini`` file, or retrieved elsewhere within
the ``env.py`` file.   The change also allows the ``alembic.ini`` file to
be completely optional if the ``pyproject.toml`` file contains a base
alembic configuration section.

Fixes: #1082
Change-Id: I7c6d1e68eb570bc5273e3500a17b342dfbd69d1b

2 months agoExecuteSQLOp rendering respects alembic_module_prefix
Avery Fischer [Tue, 13 May 2025 16:44:27 +0000 (12:44 -0400)] 
ExecuteSQLOp rendering respects alembic_module_prefix

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description

Rendering ExecuteSQLOp did not respect the `alembic_module_prefix` setting due
to having `op.` hard-coded in its template.

This change updates the render logic to use the same
`_alembic_autogenerate_prefix()` as it seems the rest of the ops use.

### Checklist

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

Fixes #1656

Closes: #1657
Pull-request: https://github.com/sqlalchemy/alembic/pull/1657
Pull-request-sha: c67f4b7ce25c363d525cd2483370b0be024160d9

Change-Id: I6ca36642ed3755a2d96824498502ada6ae16f714

2 months agoAdd file_path_separator to apply to all path splitting
Mike Werezak [Sat, 26 Apr 2025 18:57:24 +0000 (14:57 -0400)] 
Add file_path_separator to apply to all path splitting

Added new option to the ConfigParser config (typically via ``alembic.ini``)
``path_separator``. This new option supersedes the previous similar
option ``version_path_separator``.   The new ``path_separator`` option
applies to the path splitting mechanism of both the ``version_locations``
option as well as the ``prepend_sys_path`` option, and in newly
rendered ``alembic.ini`` files will use the value ``os``, which means to
use the operating system path separator when splitting these string values
into a list of paths.

The new attribute applies necessary os-dependent path splitting to the
``prepend_sys_path`` option so that windows paths which contain drive
letters with colons are not inadvertently split, whereas previously
os-dependent path splitting were only available for the
``version_locations`` option.

Existing installations that do not have ``path_separator`` present
will continue to make use of ``version_path_separator`` when parsing the
``version_locations`` option, or splitting on spaces / commas if
``version_path_separator`` is also not present.  ``prepend_sys_path`` will
continue to be split on spaces/commas/colons if ``path_separator`` is
not present.   Under all of these fallback conditions, a deprecation
warning is now emitted encouraging to set ``path_separator``.

Pull request courtesy Mike Werezak.

This change also begins to move some of the role of interpreting
of specific config options into the Config object.  This process will
continue as we look to add toml support to config.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #1330
Closes: #1331
Pull-request: https://github.com/sqlalchemy/alembic/pull/1331
Pull-request-sha: f16b35d69acddd046cbba8f28e46219c872c151d

Change-Id: Idef47e8a6947210f1eb63c3d16c4be553effa3a2

2 months agoadd SECURITY.md
Mike Bayer [Tue, 13 May 2025 13:44:25 +0000 (09:44 -0400)] 
add SECURITY.md

Change-Id: I7cecd7d6038b0aae4ef815ba024f1d0f105fcb8e

3 months agoMerge "use pep639" into main
Michael Bayer [Thu, 8 May 2025 13:01:07 +0000 (13:01 +0000)] 
Merge "use pep639" into main

3 months agouse pep639
Mike Bayer [Wed, 7 May 2025 15:34:49 +0000 (11:34 -0400)] 
use pep639

The pyproject.toml configuration has been amended to use the updated
:pep:`639` configuration for license, which eliminates loud deprecation
warnings when building the package.   Note this necessarily bumps
setuptools build requirement to 77.0.3.

Also bump black, flake8, see what's coming.

this change is modeled after the same change made in dogpile.cache
which has since been released.

Fixes: #1637
Change-Id: I9a9e22ebaebe0d257f003f5ff5b81088df3c8901

3 months agoMerge "Refactor `CommandLine` command registration" into main
Michael Bayer [Wed, 7 May 2025 15:15:12 +0000 (15:15 +0000)] 
Merge "Refactor `CommandLine` command registration" into main

3 months agoRefactor `CommandLine` command registration
Mikhail Bulash [Tue, 29 Apr 2025 19:49:35 +0000 (15:49 -0400)] 
Refactor `CommandLine` command registration

Added new :meth:`.CommandLine.register_command` method to
:class:`.CommandLine`, intended to facilitate adding custom commands to
Alembic's command line tool with minimal code required; previously this
logic was embedded internally and was not publicly accessible.  A new
recipe demonstrating this use is added.   Pull request courtesy Mikhail
Bulash.

Fixes: #1610
Closes: #1611
Pull-request: https://github.com/sqlalchemy/alembic/pull/1611
Pull-request-sha: d2ffce008317508449de9bd0bce3ff9076c5d90f

Change-Id: Icab9978357915e81bb52a9f0717f21d5ee7f8341

3 months agoSupport DROP CONSTRAINT IF EXISTS
Aaron Griffin [Wed, 30 Apr 2025 12:42:49 +0000 (08:42 -0400)] 
Support DROP CONSTRAINT IF EXISTS

Added :paramref:`.op.drop_constraint.if_exists` parameter to
:func:`.op.drop_constraint` which will render "DROP CONSTRAINT IF EXISTS".
Pull request courtesy Aaron Griffin.

Also attempting to fix unrelated issue w/ test_stubs and python
versions which may be in a separate patch if it can't work here

Fixes: #1650
Closes: #1651
Pull-request: https://github.com/sqlalchemy/alembic/pull/1651
Pull-request-sha: 1c3c0d388d36fa60b9aaa013873a415488ed7796

Change-Id: I96378d45dd00898975f450299e6f1344bb65ccff

4 months agoFix more type hint of server_default
Denis Laxalde [Wed, 2 Apr 2025 21:47:44 +0000 (17:47 -0400)] 
Fix more type hint of server_default

Follow-up commit db12e1918556dd463847db9ffb3e761231df9b1d (which is probably sufficient for type checking) by making all annotations of server_default consistent.

Closes: #1642
Pull-request: https://github.com/sqlalchemy/alembic/pull/1642
Pull-request-sha: f47c77942042a0cb3432e916f5b307aed5225533

Change-Id: Ida7ada422339caeeb368fa51463a173642dd67a7

4 months agofix `server_default` type hint
Charly Laurent [Tue, 1 Apr 2025 18:21:00 +0000 (14:21 -0400)] 
fix `server_default` type hint

### Description

The docstring of `alter_column` states: "Set to `None` to have the default removed". The type hint should accept None.

### Checklist

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

Fixes: #1639
Closes: #1641
Pull-request: https://github.com/sqlalchemy/alembic/pull/1641
Pull-request-sha: 6642187d254681712443039a95cc1f3110549654

Change-Id: Icb7246b47805d9b2c1ab70d4e26f3e09354fe190

4 months agoVersion 1.15.3 placeholder
Mike Bayer [Fri, 28 Mar 2025 13:52:16 +0000 (09:52 -0400)] 
Version 1.15.3 placeholder

4 months ago- 1.15.2 rel_1_15_2
Mike Bayer [Fri, 28 Mar 2025 13:50:14 +0000 (09:50 -0400)] 
- 1.15.2

4 months agofix AlterColumnOp modify_name ignorance
el [Fri, 28 Mar 2025 13:22:29 +0000 (09:22 -0400)] 
fix AlterColumnOp modify_name ignorance

Fixed issue where the "modified_name" of :class:`.AlterColumnOp` would not
be considered when rendering op directives for autogenerate. While
autogenerate cannot detect changes in column name, this would nonetheless
impact approaches that made use of this attribute in rewriter recipes. Pull
request courtesy lenvk.

Fixes: #1635
Closes: #1636
Pull-request: https://github.com/sqlalchemy/alembic/pull/1636
Pull-request-sha: dd103354dcf9cd8db30c66a9a4d3879e4f1c5499

Change-Id: I3e4976a3e703ecd8d69ec208b2d225a8bf6a8251

4 months agopep484 updates, again
Mike Bayer [Fri, 28 Mar 2025 13:21:49 +0000 (09:21 -0400)] 
pep484 updates, again

I merged the diff for the other PR as well, had to revert,
trying again

Change-Id: Icc28241d68626496e7c7857edb97eda0a9cf2219

4 months agoRevert "pep484 updates"
Mike Bayer [Fri, 28 Mar 2025 13:20:42 +0000 (09:20 -0400)] 
Revert "pep484 updates"

This reverts commit 03aeeb0c3701d67134885c85b187e9e6966d7d55.

4 months agopep484 updates
Mike Bayer [Fri, 28 Mar 2025 12:38:57 +0000 (08:38 -0400)] 
pep484 updates

Change-Id: I7e7d254dcff3e26f92b413596246409b1dfaab16

5 months agoMerge "Add TextClause to alter_column's server_default fields." into main
Federico Caselli [Wed, 5 Mar 2025 19:49:26 +0000 (19:49 +0000)] 
Merge "Add TextClause to alter_column's server_default fields." into main

5 months agoAdd TextClause to alter_column's server_default fields.
DanCardin [Tue, 4 Mar 2025 21:07:59 +0000 (16:07 -0500)] 
Add TextClause to alter_column's server_default fields.

Given sqlalchemy models with server_defaults, alembic may autogenerate
`existing_server_default=sa.text("...")`, which fails typechecking on
the resultant migration because `TextClause` is not currently a valid
annotated type.

Closes: #1577
Pull-request: https://github.com/sqlalchemy/alembic/pull/1577
Pull-request-sha: e21d07e55847f1e78e53f4f04bc2e458945f83fe

Change-Id: I583748e16f3fccb4d58d8c4aa0e33c00b029523c

5 months agoVersion 1.15.2 placeholder
Mike Bayer [Tue, 4 Mar 2025 22:02:54 +0000 (17:02 -0500)] 
Version 1.15.2 placeholder

5 months ago- 1.15.1 rel_1_15_1
Mike Bayer [Tue, 4 Mar 2025 21:59:14 +0000 (16:59 -0500)] 
- 1.15.1

5 months agoMerge "fix template files include" into main
Michael Bayer [Tue, 4 Mar 2025 21:58:46 +0000 (21:58 +0000)] 
Merge "fix template files include" into main

5 months agoFix linting with ruff provided in alembic.ini by scratch
Rishat Fayzullin [Tue, 4 Mar 2025 20:32:44 +0000 (15:32 -0500)] 
Fix linting with ruff provided in alembic.ini by scratch

Fixes: #1614
Closes: #1615
Pull-request: https://github.com/sqlalchemy/alembic/pull/1615
Pull-request-sha: 92342fac19adf62a148ab937d1dc82417adb6e17

Change-Id: I02f801007a877e8498fab6dd3159b65bb2412c01

5 months agofix template files include
Mike Bayer [Tue, 4 Mar 2025 19:33:59 +0000 (14:33 -0500)] 
fix template files include

Fixed an issue in the new :pep:`621` ``pyproject.toml`` layout that
prevented Alembic's template files from being included in the ``.whl`` file
in the distribution.

Fixes: #1616
Change-Id: I059e69841f918985d999aafad1319a0c7fd9d2d5

5 months agoVersion 1.15.1 placeholder
Mike Bayer [Tue, 4 Mar 2025 17:57:49 +0000 (12:57 -0500)] 
Version 1.15.1 placeholder

5 months ago- 1.15.0 rel_1_15_0
Mike Bayer [Tue, 4 Mar 2025 17:56:19 +0000 (12:56 -0500)] 
- 1.15.0

5 months agoremove some additional legacy setuptools elements
Mike Bayer [Tue, 4 Mar 2025 17:52:26 +0000 (12:52 -0500)] 
remove some additional legacy setuptools elements

copying dogpile.cache here, most importantly remove the
tag-build=dev thing since release scripts don't make edits
to pyproject.toml on this front.

Change-Id: I1fdead960c859a491376a059760938975fd17746

5 months agodont stringify uq deferrable
Mike Bayer [Wed, 26 Feb 2025 14:09:51 +0000 (09:09 -0500)] 
dont stringify uq deferrable

Fixed autogenerate rendering bug where the ``deferrable`` element of
``UniqueConstraint``, a bool, were being stringified rather than repr'ed
when generating Python code.

Fixes: #1613
Change-Id: I24bf7f3542566994559144c08cde2766d9ff4fe1

5 months agouse pep 621
Mike Bayer [Thu, 13 Feb 2025 16:53:25 +0000 (11:53 -0500)] 
use pep 621

Installation has been converted to use :pep:`621`, e.g. ``pyproject.toml``.

note that the introduction of pyproject with min python version of 3.9
is also consumed by Black which now wants to format a few test files
differently, so that is included as well.

Change-Id: I7f61abded37fd3f1d7bf32e3228fe97902029d19

5 months agochangelog edits
Mike Bayer [Thu, 13 Feb 2025 16:47:39 +0000 (11:47 -0500)] 
changelog edits

Change-Id: I8acc5d84ca10f839727fb159d5283fe74763e7a6

5 months agoMerge "Render labels in autogenerate index" into main
Michael Bayer [Wed, 12 Feb 2025 19:47:13 +0000 (19:47 +0000)] 
Merge "Render labels in autogenerate index" into main

5 months agomore 3.8 cleanups
Federico Caselli [Mon, 10 Feb 2025 20:46:34 +0000 (21:46 +0100)] 
more 3.8 cleanups

Change-Id: I7382b37781c43701020442d29f45a4bef274fffc

5 months agoremove python 3.8 from github files
Mike Bayer [Mon, 10 Feb 2025 18:47:53 +0000 (13:47 -0500)] 
remove python 3.8 from github files

they dont have 3.8 anymore

Change-Id: I3ccf04e83649f1b1112bb402b54345b7e9bf7180

5 months agoremove sqla13 tags from github files
Mike Bayer [Mon, 10 Feb 2025 18:40:59 +0000 (13:40 -0500)] 
remove sqla13 tags from github files

in ab446ab302ffb2884d0d95e2c766 we forgot to remove
the sqla 3.13 tags from the github actions

Change-Id: I1c32ab16adb1c62e061e0bd4458f07ef71a96bc0

5 months agodrop SQLAlchemy 1.3, Python 3.8
Mike Bayer [Sat, 8 Feb 2025 17:04:53 +0000 (12:04 -0500)] 
drop SQLAlchemy 1.3, Python 3.8

Jenkins issues reveal that SQLAlchemy 1.3's testing provision has
unidentified deficiencies that are causing instability with the
mssql engine.   As provisioning was highly refactored in 1.4, just drop
1.3 support rather than trying to figure out the exact thing that
changed.

Support for SQLAlchemy 1.3, which was EOL as of 2021, is now dropped from
Alembic as of version 1.15.0.

Support for Python 3.8 is dropped as of Alembic 1.15.0.  Python 3.8 is EOL.

Try pytest 8.3 as this seems to be running fine for SQLAlchemy

Change-Id: I06614a6f73d5b1a1ac5b9b04225ecb305f5b35ee

6 months agoRender labels in autogenerate index
Federico Caselli [Sat, 8 Feb 2025 11:57:31 +0000 (12:57 +0100)] 
Render labels in autogenerate index

Index autogenerate will now render labels for expressions
that use them. This is useful when applying operator classes
in PostgreSQL that can be keyed on the label name.

Fixes: #1603
Change-Id: I187a944a5021e643e264ee1ec97807f6573e5f2f

6 months agoAvoid D103 linter warnings via script.py.mako
Peter Cock [Wed, 6 Nov 2024 17:07:02 +0000 (12:07 -0500)] 
Avoid D103 linter warnings via script.py.mako

Added a basic docstring to the migration template files so that the
upgrade/downgrade methods pass the D103 linter check which requires a
docstring for public functions.  Pull request courtesy Peter Cock.

Fixes: #1567
Closes: #1568
Pull-request: https://github.com/sqlalchemy/alembic/pull/1568
Pull-request-sha: fa3bcd5926cc2523ac6f05c3c1e8c4eeafc55dda

Change-Id: I14b7863dfef01edca9c94d8dff4109efd274df3c

6 months agorefactor: add revision context to AutogenerateDiffsDetected so that wrappers may...
Louis-Amaury Chaib [Sat, 1 Feb 2025 09:02:34 +0000 (04:02 -0500)] 
refactor: add revision context to AutogenerateDiffsDetected so that wrappers may make other formatting of the diff

### Description
As discussed in #1597, AutogenerateDiffsDetected should hold contextual information so that command can be wrapped for another format (CI, pre-commit hook...)

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1598
Pull-request: https://github.com/sqlalchemy/alembic/pull/1598
Pull-request-sha: 7799320ad3c1a1bd769254d610288c97f85cb345

Change-Id: Id08bc52a0586063f177736a36a61f96232459f1c

6 months agofix tox error on python 3.8
Federico Caselli [Thu, 23 Jan 2025 20:50:14 +0000 (21:50 +0100)] 
fix tox error on python 3.8

Change-Id: I1f2f7789c803024f8feec4d8626564bbec04b386

6 months agoimprove test compat on windows and update gh workflows
Federico Caselli [Mon, 20 Jan 2025 19:36:17 +0000 (20:36 +0100)] 
improve test compat on windows and update gh workflows

Change-Id: Ia58a2db5310626ac77d7bae73fbb978f01194384

6 months agoVersion 1.14.2 placeholder
Mike Bayer [Sun, 19 Jan 2025 23:15:46 +0000 (18:15 -0500)] 
Version 1.14.2 placeholder

6 months ago- 1.14.1 rel_1_14_1
Mike Bayer [Sun, 19 Jan 2025 23:14:41 +0000 (18:14 -0500)] 
- 1.14.1

7 months agoDocs: fix layout issue in autogenerate (#1589)
Michiel W. Beijen [Wed, 8 Jan 2025 19:02:11 +0000 (20:02 +0100)] 
Docs: fix layout issue in autogenerate (#1589)

During building of the docs, I got this warning:

> alembic/docs/build/autogenerate.rst:733: WARNING: Bullet list ends without a blank line; unexpected unindent. [docutils]

This PR fixes the problem

7 months agoupdate test to support sqlalchemy inherit schema change
Federico Caselli [Sat, 4 Jan 2025 15:33:19 +0000 (16:33 +0100)] 
update test to support sqlalchemy inherit schema change

Change-Id: Ie48d45c63442001aeaa6a81dc909af32af303aa2

7 months ago2025
Mike Bayer [Thu, 2 Jan 2025 21:43:17 +0000 (16:43 -0500)] 
2025

Change-Id: Ifb33b8df2f838851f329415fa70f494acb4ccde5

7 months agocheck for variants (recursion branch) first in all cases
Mike Bayer [Tue, 24 Dec 2024 15:30:10 +0000 (10:30 -0500)] 
check for variants (recursion branch) first in all cases

Fixed bug where autogen render of a "variant" type would fail to catch the
variants if the leading type were a dialect-specific type, rather than a
generic type.

Fixes: #1585
Change-Id: I189e9ab3674b09700f2c774b600f6ff3abb52cd0

8 months agofixed typo on "Auto generating migrations" page, Fixes: #1574 (#1575)
John Higgins [Tue, 3 Dec 2024 20:52:00 +0000 (12:52 -0800)] 
fixed typo on "Auto generating migrations" page, Fixes: #1574 (#1575)

8 months agoblock write_pyi tests for py313
Mike Bayer [Tue, 3 Dec 2024 20:13:42 +0000 (15:13 -0500)] 
block write_pyi tests for py313

write_pyi.py seems to produce entirely broken results
on python 3.13

Change-Id: I037b917d9ca346e455848b0cd6d41e6ce152ddd2

8 months agoMerge "ensure rename_column works on SQLite" into main
Michael Bayer [Fri, 29 Nov 2024 17:19:37 +0000 (17:19 +0000)] 
Merge "ensure rename_column works on SQLite" into main

8 months agoensure rename_column works on SQLite
Mike Bayer [Fri, 29 Nov 2024 16:58:53 +0000 (11:58 -0500)] 
ensure rename_column works on SQLite

Modified SQLite's dialect to render "ALTER TABLE <t> RENAME COLUMN" when
:meth:`.Operations.alter_column` is used with a straight rename, supporting
SQLite's recently added column rename feature.

References: #1576
Change-Id: Ia84c4fda144c2767393e4748ced60479016f2c91

8 months agosupport separation of Numeric/Float
Mike Bayer [Mon, 25 Nov 2024 18:57:58 +0000 (13:57 -0500)] 
support separation of Numeric/Float

in [1] we are considering separating Numeric and Float.
For Alembic PostgreSQL backend we need this isinstance therefore
to check for both Numeric and Float.
By keeping it to these two types, rather than targeting the
NumericCommon type being added in [1], the patch can work with
SQLAlchemy without the separation change as well.

[1] https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3587

Change-Id: I0c956ba8797e38a62ea630ab65cd53779bbf1972

9 months agoClarify what autogenerate compares
Peter Cock [Thu, 7 Nov 2024 14:51:22 +0000 (09:51 -0500)] 
Clarify what autogenerate compares

### Description
<!-- Describe your changes in detail -->
I was struggling with empty upgrade/downgrade functions because both my database and my ORM were up to date. I wrongly assumed the comparison was against the previous database scheme as per the prior revision script(s).

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1570
Pull-request: https://github.com/sqlalchemy/alembic/pull/1570
Pull-request-sha: dec968b136a813d27e1d2bca04574a2399343a1a

Change-Id: I04dadc3c3d26ad000aca499208d8024cd63eec40

9 months agoFix `alembic.ini` templates to match `configparser` file format.
Michael Bayer [Wed, 6 Nov 2024 23:43:43 +0000 (18:43 -0500)] 
Fix `alembic.ini` templates to match `configparser` file format.

In the `alembic.ini` templates, I moved the inline comment about `version_path_separator` to their own lines as required by `configparser`.

### Description

In a recent project, I included the following configuration values in my `alembic.ini`. Note that the last line is the default line from the current generic `alembic.ini` template.

```
# version location specification; This defaults
# to migrations/versions.  When using multiple version
# directories, initial revisions must be specified with --version-path.
# The path separator used here should be the separator specified by "version_path_separator" below.
version_locations = %(here)s/migrations/versions

# version path separator; As mentioned above, this is the character used to split
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
# Valid values for version_path_separator are:
#
# version_path_separator = :
# version_path_separator = ;
# version_path_separator = space
version_path_separator = os  # Use os.pathsep. Default configuration used for new projects.
```

When running `alembic check`, I encountered:

```
ValueError: 'os  # Use os.pathsep. Default configuration used for new projects.' is not a valid value for version_path_separator; expected 'space', 'os', ':', ';'
```

It seemed that the comment in the last line was being included as part of the parsed config value, which should be `os`.

Alembic currently [uses `configparser.ConfigParser` from the standard libary](https://github.com/sqlalchemy/alembic/blob/2d60c77c81a72a78b575b96aef511e658073dec5/alembic/util/compat.py#L82-L89) to parse `alembic.ini` files. The [default `configparser` file format](https://docs.python.org/3/library/configparser.html#supported-ini-file-structure) requires that comments be on their own lines, although this can be customized. I changed the three copies of this line in Alembic's `alembic.ini` templates to remove the inline comments. In my case, this change fixed the `ValueError`.

This issue could also be fixed by changing [the default instance of `ConfigParser`](https://github.com/sqlalchemy/alembic/blob/2d60c77c81a72a78b575b96aef511e658073dec5/alembic/config.py#L202), using `inline_comment_prefixes=("#",)`. I imagine, however, that it might be better to use the default file format.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1397
Pull-request: https://github.com/sqlalchemy/alembic/pull/1397
Pull-request-sha: 073cbd9b076fffa78be3b374e20ece4a2562f7bd

Change-Id: I49bc76994617a3c17a2443a4e4387c2479a661a4

9 months agoMerge "Improve write_pyi usage" into main
Michael Bayer [Wed, 6 Nov 2024 23:41:17 +0000 (23:41 +0000)] 
Merge "Improve write_pyi usage" into main

9 months agoMerge "fix: Correct the AutogenContext.metadata typing to include Sequence[MetaData...
Michael Bayer [Wed, 6 Nov 2024 23:37:22 +0000 (23:37 +0000)] 
Merge "fix: Correct the AutogenContext.metadata typing to include Sequence[MetaData]." into main

9 months agoImprove write_pyi usage
Aaron Griffin [Wed, 6 Nov 2024 20:40:56 +0000 (15:40 -0500)] 
Improve write_pyi usage

Fixes #1524
### Description

Due to some problems when running write_pyi, this includes the following changes:

1. move the sys.path.append up before alembic is imported - this is using global imports otherwise
2. use tox to run write_pyi in order to avoid globally installed dependencies

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1525
Pull-request: https://github.com/sqlalchemy/alembic/pull/1525
Pull-request-sha: 679ea5c67ebbf5062891d50dabf6323cf5348d82

Change-Id: I2d837a5dfe3cb252a0f0a6937310741045103da6

9 months agofix(requirements): add `tzdata` to `tz` extras; fixes #1556
Danipulok [Wed, 6 Nov 2024 17:06:50 +0000 (12:06 -0500)] 
fix(requirements): add `tzdata` to `tz` extras; fixes #1556

Add `tzdata` to `tz` extras, since `zoneinfo` on its own does not contain any timezones.

Fixes: #1556
Closes: #1558
Pull-request: https://github.com/sqlalchemy/alembic/pull/1558
Pull-request-sha: 9c60d7c1a2d4171511828ae60de0649905297a17

Change-Id: Ibf6d863a7cd277c6abffcf2853f452a5b16c5fd5

9 months agofix: Correct the AutogenContext.metadata typing to include Sequence[MetaData].
DanCardin [Wed, 6 Nov 2024 17:10:12 +0000 (12:10 -0500)] 
fix: Correct the AutogenContext.metadata typing to include Sequence[MetaData].

### Description
The type annotation for AutogenContext.metadata is currently `Optional[MetaData]`, but `target_metadata` is `Union[MetaData, Sequence[MetaData], None]`. Seems like setting `target_metadata` to `[]` directly translates into the list that `AutogenContext` receives, and that the code is already coercing the potential single/sequence to always be a list.

My alembic plugin wasn't aware that this **could** be a list, and as such wasn't handling the possibility properly.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1547
Pull-request: https://github.com/sqlalchemy/alembic/pull/1547
Pull-request-sha: 1bdfa18739e3d156f267953c71267feeded9543b

Change-Id: Ib3114b19c10983114b834676ada69d7475e82fe5

9 months agoUpdate tutorial.rst for ruff post_write_hooks (#1535)
A [Tue, 5 Nov 2024 18:29:48 +0000 (21:29 +0300)] 
Update tutorial.rst for ruff post_write_hooks (#1535)

Due ruff package update - `ruff <path>` has been removed. Use `ruff check <path>` instead.

9 months agoAdd missing imports to example (#1569)
Peter Cock [Tue, 5 Nov 2024 18:29:26 +0000 (18:29 +0000)] 
Add missing imports to example (#1569)

9 months agoVersion 1.14.1 placeholder
Mike Bayer [Mon, 4 Nov 2024 18:44:38 +0000 (13:44 -0500)] 
Version 1.14.1 placeholder

9 months ago- 1.14.0 rel_1_14_0
Mike Bayer [Mon, 4 Nov 2024 18:42:48 +0000 (13:42 -0500)] 
- 1.14.0

9 months ago1.14
Mike Bayer [Mon, 4 Nov 2024 18:42:11 +0000 (13:42 -0500)] 
1.14

Change-Id: Ie1070d8cafe93a94b77b9fa861ac8284c44f06af

9 months agoAdd ability to configure alembic_version table in DialectImpl
Maciek Bryński [Thu, 31 Oct 2024 21:29:40 +0000 (17:29 -0400)] 
Add ability to configure alembic_version table in DialectImpl

Added a new hook to the :class:`.DefaultImpl`
:meth:`.DefaultImpl.version_table_impl`.  This allows third party dialects
to define the exact structure of the alembic_version table, to include use
cases where the table requires special directives and/or additional columns
so that it may function correctly on a particular backend.  This is not
intended as a user-expansion hook, only a dialect implementation hook to
produce a working alembic_version table. Pull request courtesy Maciek
Bryński.

This will be 1.14 so this also version bumps

Fixes: #1560
Closes: #1563
Pull-request: https://github.com/sqlalchemy/alembic/pull/1563
Pull-request-sha: e70fdc8f4e405cabf5099c2100763d7b24da3be8

Change-Id: I5e565dff60a979526608d2a1c0c620fbca269a3f

9 months agoFix mypy linting issues
Maciek Bryński [Thu, 31 Oct 2024 16:47:35 +0000 (12:47 -0400)] 
Fix mypy linting issues

### Description

Fixing mypy linting issues for new mypy version.

### Checklist

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1564
Pull-request: https://github.com/sqlalchemy/alembic/pull/1564
Pull-request-sha: a79d47d3acf7ae628ead7ca829bfe1c6f864c3c9

Change-Id: I3be88b6328dc07c46e6b1ddf8c85480dc88cfe95

10 months agoUse logging.WARNING instead of logging.WARN
Zubarev Grigoriy [Sat, 5 Oct 2024 21:14:02 +0000 (17:14 -0400)] 
Use logging.WARNING instead of logging.WARN

The `WARN` constant is an undocumented alias for `WARNING`. Whilst it’s not deprecated, it’s not mentioned at all in the documentation. This references one of  `flake8-logging` plugins [rule](https://github.com/adamchainz/flake8-logging?tab=readme-ov-file#log009-warn-is-undocumented-use-warning-instead).

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
Changed all uses of `logging.WARN` to `logging.WARNING`.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1548
Pull-request: https://github.com/sqlalchemy/alembic/pull/1548
Pull-request-sha: 249b9a2942037f8da9f2db5736d1d988435b6fe5

Change-Id: I7c64ce9bb18af551c761ed9216713ee02cbbb83b

10 months agoVersion 1.13.4 placeholder
Mike Bayer [Mon, 23 Sep 2024 14:52:36 +0000 (10:52 -0400)] 
Version 1.13.4 placeholder

10 months ago- 1.13.3 rel_1_13_3
Mike Bayer [Mon, 23 Sep 2024 14:51:00 +0000 (10:51 -0400)] 
- 1.13.3

10 months agoadd mypy marker to pytest; pytest opts in pyproject.toml
Mike Bayer [Mon, 23 Sep 2024 14:23:44 +0000 (10:23 -0400)] 
add mypy marker to pytest; pytest opts in pyproject.toml

this is to avoid warnings generated by SQLAlchemy's test
config

Change-Id: I91026a4bbd36eead3856e9394dc7c1d85b703e47

10 months agochangelog edit
Mike Bayer [Mon, 23 Sep 2024 13:58:48 +0000 (09:58 -0400)] 
changelog edit

Change-Id: Iee173287d358ce75c3082242ba2d200871b58fee

10 months agoRender `if_not_exists` option for CreateTableOp, CreateIndexOp, DropTableOp and...
Louis-Amaury Chaib [Mon, 23 Sep 2024 12:23:02 +0000 (08:23 -0400)] 
Render `if_not_exists`  option for CreateTableOp, CreateIndexOp, DropTableOp and DropIndexOp

Render ``if_exists`` and ``if_not_exists`` parameters in
:class:`.CreateTableOp`, :class:`.CreateIndexOp`, :class:`.DropTableOp` and
:class:`.DropIndexOp` in an autogenerate context.  While Alembic does not
set these parameters during an autogenerate run, they can be enabled using
a custom :class:`.Rewriter` in the ``env.py`` file, where they will now be
part of the rendered Python code in revision files.  Pull request courtesy
of Louis-Amaury Chaib (@lachaib).

Closes: #1446
Pull-request: https://github.com/sqlalchemy/alembic/pull/1446
Pull-request-sha: 90c9735767af1cf3ba7e40e71dfa0fb30efc1ee8

Change-Id: I6b0a5ffaf7e2d1a0a1e1f1e80ed0ee168ae2bd09

10 months agoSupport if_exists and if_not_exists on create/drop table commands
Aaron Griffin [Tue, 10 Sep 2024 14:36:13 +0000 (10:36 -0400)] 
Support if_exists and if_not_exists on create/drop table commands

Added support for :paramref:`.Operations.create_table.if_not_exists` and
:paramref:`.Operations.drop_table.if_exists`, adding similar functionality
to render IF [NOT] EXISTS for table operations in a similar way as with
indexes. Pull request courtesy Aaron Griffin.

Fixes: #1520
Closes: #1521
Pull-request: https://github.com/sqlalchemy/alembic/pull/1521
Pull-request-sha: 469be01c6b5f9f42dc26017040a6fc54c4caef54

Change-Id: I5dcf44d9e906cdb84c32c4bfb6a1c63cde6324fd

11 months agounpin setuptools
Mike Bayer [Mon, 2 Sep 2024 15:33:26 +0000 (11:33 -0400)] 
unpin setuptools

The pin for ``setuptools<69.3`` in ``pyproject.toml`` has been removed.
This pin was to prevent a sudden change to :pep:`625` in setuptools from
taking place which changes the file name of SQLAlchemy's source
distribution on pypi to be an all lower case name, and the change was
extended to all SQLAlchemy projects to prevent any further surprises.
However, the presence of this pin is now holding back environments that
otherwise want to use a newer setuptools, so we've decided to move forward
with this change, with the assumption that build environments will have
largely accommodated the setuptools change by now.

Change-Id: I0cd9ab0512004669a8f0aa0cb7f560d89a2da2bd

11 months agoadd cool github /pypi link stuff
Mike Bayer [Mon, 19 Aug 2024 16:27:55 +0000 (12:27 -0400)] 
add cool github /pypi link stuff

Change-Id: I57ec7a22a1d14992cc0f70d527a584a737022e21

11 months agosome updates to the commit for multi-tenant I just did
Mike Bayer [Mon, 19 Aug 2024 15:13:27 +0000 (11:13 -0400)] 
some updates to the commit for multi-tenant I just did

Change-Id: I5e9c03697af5d65f68c37bf4afd6caaf73ce270a

11 months agoadd mysql/mariadb to multi-tenant recipe
Mike Bayer [Mon, 19 Aug 2024 15:09:41 +0000 (11:09 -0400)] 
add mysql/mariadb to multi-tenant recipe

we can use USE just as easily as search_path here, so add that.

Change-Id: I0af8b7c15c9647c613ba6e0aae99173745df29af

12 months agoMerge "Enhance version_path_separator behaviour by adding a newline option" into...
Michael Bayer [Mon, 5 Aug 2024 19:04:00 +0000 (19:04 +0000)] 
Merge "Enhance version_path_separator behaviour by adding a newline option" into main

12 months agoadd a test for FK w/ naming convention; update mypy thing
Mike Bayer [Sat, 3 Aug 2024 20:44:22 +0000 (16:44 -0400)] 
add a test for FK w/ naming convention; update mypy thing

There seems to be some dependency for mypy stated in tox for
unclear reasons that no longer exists, remove it

References: https://github.com/sqlalchemy/alembic/discussions/1029#discussioncomment-10232170
Change-Id: Ied1a578f99ece0875e5d964b4f47a7759c9b2267

12 months agoEnhance version_path_separator behaviour by adding a newline option
Pavel V. Pristupa [Tue, 30 Jul 2024 05:45:20 +0000 (01:45 -0400)] 
Enhance version_path_separator behaviour by adding a newline option

### Description
version_path_separator now consists a new option "newline" which allows you to specify multiple version locations across multiple lines like this:
```
version_locations =
  /foo/versions
  /bar/versions
  /baz/versions

version_path_separator = newline
```

### Checklist
This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [x] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1510
Pull-request: https://github.com/sqlalchemy/alembic/pull/1510
Pull-request-sha: 6155da71472fa2727beabd0aeaec1bdc07378b1b

Change-Id: I364906906a9c7164e8f7fa5f51f3097ab118cc65

12 months agoadd compatibility with mypy 1.11
Federico Caselli [Fri, 26 Jul 2024 19:35:52 +0000 (21:35 +0200)] 
add compatibility with mypy 1.11

Change-Id: Ieaa150c8aec70d54e87aa3355f5fc37c232f47ae

13 months agoremove sidebar toggle here, it's in site build
Mike Bayer [Mon, 1 Jul 2024 13:23:21 +0000 (09:23 -0400)] 
remove sidebar toggle here, it's in site build

Change-Id: Ida2ac231d708679e57d7c59ee426a59c72b4f89c

13 months agoswitch to book theme
Mike Bayer [Wed, 26 Jun 2024 18:34:53 +0000 (14:34 -0400)] 
switch to book theme

Change-Id: I034a5a9511fa2c0eecedb979ea965d53632416d1

13 months agoVersion 1.13.3 placeholder
Mike Bayer [Wed, 26 Jun 2024 15:46:34 +0000 (11:46 -0400)] 
Version 1.13.3 placeholder

13 months ago- 1.13.2 rel_1_13_2
Mike Bayer [Wed, 26 Jun 2024 15:37:04 +0000 (11:37 -0400)] 
- 1.13.2

13 months agopin setuptools below 69.3 and prepare for "build" for releases
Mike Bayer [Wed, 19 Jun 2024 15:48:25 +0000 (11:48 -0400)] 
pin setuptools below 69.3 and prepare for "build" for releases

Change-Id: Ib70446cc3c7d7d8acb264ffa2237a0c7aac5a0f5

14 months agoFix postgres detect serial in autogenerate (#1479)
zhouyizhen [Wed, 5 Jun 2024 19:28:53 +0000 (15:28 -0400)] 
Fix postgres detect serial in autogenerate (#1479)

<!-- Provide a general summary of your proposed changes in the Title field above -->
Fixes: https://github.com/sqlalchemy/alembic/issues/1479
### Description
<!-- Describe your changes in detail -->
In https://github.com/sqlalchemy/alembic/issues/73, it tries to detact postgresql serial in autogenerate, so it won't take `nextval('seq'::regclass)` as server default for that column.
But it takes not effect for tables not in search path. This PR fixed it.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1486
Pull-request: https://github.com/sqlalchemy/alembic/pull/1486
Pull-request-sha: 24df8f906d281df92c531df5a9e1f64d8cdb8527

Change-Id: I50276875bfb1d4f920f0fcd20136337ae09b5384

15 months agoAdd missing space in error message
Federico Caselli [Wed, 24 Apr 2024 20:13:10 +0000 (22:13 +0200)] 
Add missing space in error message

Fixes: #1464
Change-Id: I9dd5a6c48c685d347ffa35f12afb79845c347003

15 months agofix typo in docs
Federico Caselli [Wed, 24 Apr 2024 19:29:43 +0000 (21:29 +0200)] 
fix typo in docs

Fixes: #1463
Change-Id: Ic7aa3ba1b3fd40e3563f5c419ed3cf6cbe0d985d

15 months agoMerge "Fix constraint_name type in create_primary_key" into main
Federico Caselli [Wed, 24 Apr 2024 19:27:06 +0000 (19:27 +0000)] 
Merge "Fix constraint_name type in create_primary_key" into main

15 months agodont duplicate ModelOne; block A005
Mike Bayer [Wed, 17 Apr 2024 17:21:16 +0000 (13:21 -0400)] 
dont duplicate ModelOne; block A005

this is already in the fixtures.  block new flake8 A005
warning nobody asked for

Change-Id: Ic4f3ec3d1eee5333edb3f48ac95b09ad1b8fdbdf

16 months agoFix constraint_name type in create_primary_key
kasium [Thu, 4 Apr 2024 18:11:58 +0000 (14:11 -0400)] 
Fix constraint_name type in create_primary_key

The constraint name in create_primary_key should be optional, but for batch operations is is required according to the type annotations

### Description
Changed the type annotation to `Optional[str]`

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [X] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1452
Pull-request: https://github.com/sqlalchemy/alembic/pull/1452
Pull-request-sha: 8afb2bf3fbddc1b04a9da7c5cc5553dea2c1c593

Change-Id: Ic7bbbbfda85dafccdf44c73a6233140aa7e96a2d

16 months agoadd additional seealsos for schema name
Mike Bayer [Tue, 19 Mar 2024 12:14:53 +0000 (08:14 -0400)] 
add additional seealsos for schema name

References: #1447
Change-Id: I1b045cd811f793f1ef19da46ee4cfd3bd737dc88

16 months agoClarify how script_location can be os agnostic
Federico Caselli [Mon, 18 Mar 2024 21:29:01 +0000 (22:29 +0100)] 
Clarify how script_location can be os agnostic

Fixes: #1431
Change-Id: Iafe70621911614d197e5e5ecf74afecd6f4df10e

17 months agoMerge "use SQLAlchemy's xdist methods" into main
Michael Bayer [Mon, 4 Mar 2024 05:45:20 +0000 (05:45 +0000)] 
Merge "use SQLAlchemy's xdist methods" into main

17 months agoMerge "Improve commands doc strings" into main
Michael Bayer [Mon, 4 Mar 2024 04:51:01 +0000 (04:51 +0000)] 
Merge "Improve commands doc strings" into main