]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
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

7 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)

7 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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.

8 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)

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

8 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

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

Change-Id: Ie1070d8cafe93a94b77b9fa861ac8284c44f06af

8 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

8 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

9 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

10 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

11 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

11 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

12 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

13 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

15 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

16 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

16 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

16 months agouse SQLAlchemy's xdist methods
Mike Bayer [Mon, 4 Mar 2024 04:11:50 +0000 (23:11 -0500)] 
use SQLAlchemy's xdist methods

Fixes to support pytest 8.1 for the test suite.

the use of teardown() was based on pytest's nose
compat, which is removed.  their xdist style tests use the name
"setup_method()" and "teardown_method()" now.

We have SQLAlchemy's pytestplugin in use which uses pytest fixtures
to invoke our own xdist style setUp and tearDown methods, which we
are already using here, so use those for this one test.

Fixes: #1435
Change-Id: I4c49e81fca6bfa957594714009531fe12691ace5

16 months agoRevert "block pytest 8"
Mike Bayer [Mon, 4 Mar 2024 04:17:45 +0000 (23:17 -0500)] 
Revert "block pytest 8"

This reverts commit d90922d4afbc751b629c3cdf614d273eb143ced4.

an errant breakpoint() got in there.

16 months agoblock pytest 8
Mike Bayer [Mon, 4 Mar 2024 03:40:53 +0000 (22:40 -0500)] 
block pytest 8

something has changed and teardown() is no longer called.
SQLAlchemy seems to also be pinned below pytest 8 (which we need to fix)
so this is likely related

Change-Id: I784b3abde67528c30af06a01b3a02d481a29276f

16 months agoadd rel_2_0 target
Mike Bayer [Mon, 4 Mar 2024 03:23:40 +0000 (22:23 -0500)] 
add rel_2_0 target

Change-Id: I19317c5f67c0e7269352f938d7f4351dd1c8115c

17 months agoImprove commands doc strings
Federico Caselli [Wed, 14 Feb 2024 19:31:16 +0000 (20:31 +0100)] 
Improve commands doc strings

Fixes: #1420
Change-Id: Id8626bd5bb87920abf83e5511130dbbfa8916465

17 months agoFix type annotations in create_foreign_key (#1430)
kasium [Thu, 22 Feb 2024 19:31:30 +0000 (20:31 +0100)] 
Fix type annotations in create_foreign_key (#1430)

The constraint name parameter of create_foreign_key should be optional, but the batch function
defined it as str instead of Optional[str].

Closes #1429

17 months agoUpdate black to 24.1.1
Federico Caselli [Wed, 14 Feb 2024 19:35:24 +0000 (20:35 +0100)] 
Update black to 24.1.1

Change-Id: Iebd9b9e866a6a58541c187e70d4f170fdf84daff

18 months agoUpdate license year to 2024
Giovanni Pellerano [Mon, 22 Jan 2024 19:16:55 +0000 (14:16 -0500)] 
Update license year to 2024

None

Closes: #1400
Pull-request: https://github.com/sqlalchemy/alembic/pull/1400
Pull-request-sha: 477619ca80e04484ac5bf46c03e7c39df3ecd2bc

Change-Id: I7f419a6c0d6b31ccd5731914657cdda41b8f4802

18 months agoMerge "Ignore newlines in expressions for Computed" into main
Michael Bayer [Mon, 15 Jan 2024 15:09:34 +0000 (15:09 +0000)] 
Merge "Ignore newlines in expressions for Computed" into main

18 months agoMerge "fix alembic.util.messaging.msg to properly wrap at terminal width" into main
Michael Bayer [Sat, 13 Jan 2024 15:50:32 +0000 (15:50 +0000)] 
Merge "fix alembic.util.messaging.msg to properly wrap at terminal width" into main

18 months agofix alembic.util.messaging.msg to properly wrap at terminal width
Saif Hakim [Fri, 5 Jan 2024 15:38:36 +0000 (10:38 -0500)] 
fix alembic.util.messaging.msg to properly wrap at terminal width

Fixed bug in alembic command stdout where long messages were not properly
wrapping at the terminal width.   Pull request courtesy Saif Hakim.

Fixes: #1384
Closes: #1385
Pull-request: https://github.com/sqlalchemy/alembic/pull/1385
Pull-request-sha: ff59fa59861487cee1943090acc970d9a64f7e96

Change-Id: Ia584d840ca1a9a01e224b92dc4cdcae880ea13aa

18 months agoIgnore newlines in expressions for Computed
Georg Wicke-Arndt [Wed, 10 Jan 2024 18:35:14 +0000 (13:35 -0500)] 
Ignore newlines in expressions for Computed

Fixes #1391
Closes: #1393
Pull-request: https://github.com/sqlalchemy/alembic/pull/1393
Pull-request-sha: 69959241d491d9e08c4fb0bc38328a232e89811b

Change-Id: I4aa1e8c344aa87a7277bf1f57dde67a37f510bff

18 months agodont pass empty sequences to connection.execute()
Mike Bayer [Wed, 10 Jan 2024 15:13:16 +0000 (10:13 -0500)] 
dont pass empty sequences to connection.execute()

Fixed internal issue where Alembic would call ``connection.execute()``
sending an empty tuple to indicate "no params".  In SQLAlchemy 2.1 this
case will be deprecated as "empty sequence" is ambiguous as to its intent.

Fixes: #1394
Change-Id: If3105866a13f4e3ffdcd513de3f970257ea48089

19 months agoVersion 1.13.2 placeholder
Mike Bayer [Wed, 20 Dec 2023 17:06:28 +0000 (12:06 -0500)] 
Version 1.13.2 placeholder

19 months ago- 1.13.1 rel_1_13_1
Mike Bayer [Wed, 20 Dec 2023 17:03:48 +0000 (12:03 -0500)] 
- 1.13.1

19 months agochangelog updates
Mike Bayer [Wed, 20 Dec 2023 16:17:53 +0000 (11:17 -0500)] 
changelog updates

Change-Id: I43bcd06ba5b48a97bc9270f33fbf893dc4c8408e

19 months agoMerge "Improve `Rewriter` implementation" into main
Michael Bayer [Wed, 20 Dec 2023 13:53:58 +0000 (13:53 +0000)] 
Merge "Improve `Rewriter` implementation" into main

19 months agoremove python 3.9 from pep-484 suite on github actions
Mike Bayer [Wed, 20 Dec 2023 00:06:11 +0000 (19:06 -0500)] 
remove python 3.9 from pep-484 suite on github actions

since the major typing update in f443584f994a7a6426197f9f
just merged, python 3.9 is failing
for some reason, but 3.9 support w/ 100% mypy is not priority,
just remove from gh actions

Change-Id: Iddc096e51d685a3933a1cdbdb6c47782870973d4

19 months agoMerge "finish strict typing for most modules" into main
Michael Bayer [Tue, 19 Dec 2023 23:50:45 +0000 (23:50 +0000)] 
Merge "finish strict typing for most modules" into main

19 months agofinish strict typing for most modules
Mike Bayer [Wed, 13 Dec 2023 16:05:03 +0000 (11:05 -0500)] 
finish strict typing for most modules

Updated pep-484 typing to pass mypy "strict" mode, however including
per-module qualifications for specific typing elements not yet complete.
This allows us to catch specific typing issues that have been ongoing
such as import symbols not properly exported.

Fixes: #1377
Change-Id: I69db4d23460f02161ac771d5d591b2bc802b8ab1

19 months agoFix downgrade when normalized down revisions have overlap via depends_on
Saif Hakim [Wed, 13 Dec 2023 05:59:59 +0000 (00:59 -0500)] 
Fix downgrade when normalized down revisions have overlap via depends_on

Fixed bug in versioning model where a downgrade across a revision with two
down revisions with one down revision depending on the other, would produce
an erroneous state in the alembic_version table, making upgrades impossible
without manually repairing the table.  Thanks much to Saif Hakim for
the great work on this.

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

When the alembic tree has a migration (a1), with a branched migration (b1) that `depends_on` that migration, followed by a merge migration that merges (a1) and (b1), running the merge migrations downgrade incorrectly updates the heads to [a1, b1], when it should actually just have [b1]. This then prevents a user from running the upgrade again due to the confusing error:
> Requested revision b1 overlaps with other requested revisions a1

The problem occurs in `HeadMaintainer.update_to_step` which will update the value of heads by calling out into a helper method based on the scenario: deleting branches, creating branches, merging branches, unmerging branches, or the typical non-branched migration. As it turns out, all of these methods have logic to determine the canonical set of heads that should be written, _except_ in the case we are unmerging, resulting in the redundant head.

To fix, we simply remove any ancestors of the target heads from the list of target heads when doing an unmerge.

Fixes: #1373
Closes: #1376
Pull-request: https://github.com/sqlalchemy/alembic/pull/1376
Pull-request-sha: dc8c7f8f7f8bc8e753aac8b8a1d6d70d79b12573

Change-Id: I7e1b5a969ea4487001606b20d3853f7c83015706

19 months agoImprove `Rewriter` implementation
l-hedgehog [Mon, 11 Dec 2023 20:24:56 +0000 (15:24 -0500)] 
Improve `Rewriter` implementation

Fixes #1337

### Description
* Fix the chaining of more than two rewriters
* Wrap a callable so that it could be chained

This works in my local test, and I hope it makes sense to use the callable wrapper as the base class.

### 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.

Closes: #1368
Pull-request: https://github.com/sqlalchemy/alembic/pull/1368
Pull-request-sha: e62633dbbb9b8dd91a145a6f27efcdbe4e4c0b3b

Change-Id: I7642a3ec8c6b8923f70ae8e7b6dbd482cb15eff9

19 months agoKeep the unique flag in `DropIndexOp`
Iuri de Silvio [Mon, 4 Dec 2023 18:22:22 +0000 (13:22 -0500)] 
Keep the unique flag in `DropIndexOp`

Fixed issue where the "unique" flag of an ``Index`` would not be maintained
when generating downgrade migrations.  Pull request courtesy Iuri de
Silvio.

Fixes: #1371
Closes: #1372
Pull-request: https://github.com/sqlalchemy/alembic/pull/1372
Pull-request-sha: 515b4ed049048d4f5d178ed1777018d5e0c34968

Change-Id: Id4ff7212e2738f2b38ba0a9a8f12bccdc1796b55

19 months agoFix `get_x_arguments(as_dictionary=True)` for args without `=`
Iuri de Silvio [Mon, 4 Dec 2023 16:55:24 +0000 (11:55 -0500)] 
Fix `get_x_arguments(as_dictionary=True)` for args without `=`

Fixed issue where ``get_x_arguments(as_dictionary=True)`` would fail if an
argument key were passed without an equal sign ``=`` or a value.
Behavior is repaired where this condition is detected and will return a
blank string for the given key, consistent with the behavior where the
``=`` sign is present and no value.  Pull request courtesy Iuri de Silvio.

Fixes: #1369
Closes: #1370
Pull-request: https://github.com/sqlalchemy/alembic/pull/1370
Pull-request-sha: 830a69076653d0849f0b3eba2ecbf6ff16700049

Change-Id: I610d2d9022a0a08e56e0f62f6890f3f0d5bc169a

19 months agoVersion 1.13.1 placeholder
Mike Bayer [Fri, 1 Dec 2023 15:25:25 +0000 (10:25 -0500)] 
Version 1.13.1 placeholder

19 months ago- 1.13.0 rel_1_13_0
Mike Bayer [Fri, 1 Dec 2023 15:24:04 +0000 (10:24 -0500)] 
- 1.13.0

20 months agoMerge "Fix 'alembic check' with multidb env" into main
mike bayer [Wed, 22 Nov 2023 20:53:41 +0000 (20:53 +0000)] 
Merge "Fix 'alembic check' with multidb env" into main

20 months agoFix 'alembic check' with multidb env
Neil Williams [Wed, 22 Nov 2023 18:51:48 +0000 (13:51 -0500)] 
Fix 'alembic check' with multidb env

Fixed issue where the ``alembic check`` command did not function correctly
with upgrade structures that have multiple, top-level elements, as are
generated from the "multi-env" environment template.  Pull request courtesy
Neil Williams.

Fixes: #1234
Closes: #1365
Pull-request: https://github.com/sqlalchemy/alembic/pull/1365
Pull-request-sha: fc9be8646ef3e822b6cb0ddeecdeb6f2ff1e72eb

Change-Id: I38a1c19000c322e368701fb481899534aecf2cee

20 months agoadd tzdata to tox dependencies
Mike Bayer [Wed, 22 Nov 2023 19:17:57 +0000 (14:17 -0500)] 
add tzdata to tox dependencies

GH actions on windows seem to lack this package, see if adding
it fixes things.

Change-Id: I9b830c583bbf541d965d6e76e08b68a88f645c54

20 months agoFix typo in alembic.ini templates
Merouane Atig [Wed, 22 Nov 2023 17:42:46 +0000 (12:42 -0500)] 
Fix typo in alembic.ini templates

### Description

Fix typo in alembic.ini templates: requied => required

### Checklist

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: #1364
Pull-request: https://github.com/sqlalchemy/alembic/pull/1364
Pull-request-sha: e200e174da7d6ca4ae943fc48cd7ff9af686f11a

Change-Id: I862a3fa54df907b4d8b25f5ee8b5ca82992f1966

20 months agorst typo
Mike Bayer [Tue, 21 Nov 2023 21:08:19 +0000 (16:08 -0500)] 
rst typo

Change-Id: I4b4679824251c0f16ce92ab8ff70aa481495a152

20 months agothis is 1.13.0 for changelog
Mike Bayer [Tue, 21 Nov 2023 21:07:40 +0000 (16:07 -0500)] 
this is 1.13.0 for changelog

Change-Id: Ica5732aeea5c36029011c17b64bd59a2a0e3064c

20 months agoMerge "More PostgreSQL expression index compare fixes" into main
mike bayer [Tue, 21 Nov 2023 21:07:00 +0000 (21:07 +0000)] 
Merge "More PostgreSQL expression index compare fixes" into main

20 months agoMore PostgreSQL expression index compare fixes
Federico Caselli [Sat, 21 Oct 2023 19:06:57 +0000 (21:06 +0200)] 
More PostgreSQL expression index compare fixes

Additional fixes to PostgreSQL expression index compare feature.
The compare now correctly accommodates casts and differences in
spacing.
Added detection logic for operation clauses inside the expression,
skipping the compare of these expressions.
To accommodate these changes the logic for the comparison of the
indexes and unique constraints was moved to the dialect
implementation, allowing greater flexibility.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #1321
Fixes: #1327
Fixes: #1356
Change-Id: Icad15bc556a63bfa55b84779e7691c745d943c63

20 months agoMerge "add batch template for render create_table_comment, drop_table_comment" into...
mike bayer [Mon, 20 Nov 2023 13:35:04 +0000 (13:35 +0000)] 
Merge "add batch template for render create_table_comment, drop_table_comment" into main

20 months agoadd batch template for render create_table_comment, drop_table_comment
Mike Bayer [Sat, 18 Nov 2023 14:58:13 +0000 (09:58 -0500)] 
add batch template for render create_table_comment, drop_table_comment

Fixed autogenerate issue where ``create_table_comment()`` and
``drop_table_comment()`` rendering in a batch table modify would include
the "table" and "schema" arguments, which are not accepted in batch as
these are already part of the top level block.

Fixes: #1361
Change-Id: I12a01ee2a69ba89138dfda7bfda04bbc83929550

20 months agoUse zoneinfo instead of dateutil.
Federico Caselli [Thu, 26 Oct 2023 22:10:01 +0000 (00:10 +0200)] 
Use zoneinfo instead of dateutil.

Replaced ``python-dateutil`` with the standard library module
`zoneinfo <https://docs.python.org/3.11/library/zoneinfo.html#module-zoneinfo>`.
This module was added in Python 3.9, so previous version will been
to install the backport of it, available by installing the ``backports.zoneinfo``
library. The ``alembic[tz]`` option has been updated accordingly.

Fixes: #1339
Change-Id: I935fcca52ae0d3b80dacbf05137ab57ee54d054c

20 months agoMerge "Alembic 1.13 now supports Python 3.8 and above" into main
mike bayer [Sat, 18 Nov 2023 14:32:58 +0000 (14:32 +0000)] 
Merge "Alembic 1.13 now supports Python 3.8 and above" into main

20 months agoAlembic 1.13 now supports Python 3.8 and above
Federico Caselli [Thu, 16 Nov 2023 19:51:15 +0000 (20:51 +0100)] 
Alembic 1.13 now supports Python 3.8 and above

Fixes: #1359
Change-Id: I93d4f4e4b326acb1430749e7cd3a53577c40f349

20 months agoMerge "Open up `if_(not_)?exists` to SQLAlchemy 1.4+" into main
mike bayer [Fri, 17 Nov 2023 14:17:48 +0000 (14:17 +0000)] 
Merge "Open up `if_(not_)?exists` to SQLAlchemy 1.4+" into main

20 months agoOpen up `if_(not_)?exists` to SQLAlchemy 1.4+
l-hedgehog [Thu, 16 Nov 2023 14:23:47 +0000 (09:23 -0500)] 
Open up `if_(not_)?exists` to SQLAlchemy 1.4+

Fixes #1323

### Description
As the title describes, open up `if_(not_)?exists` support (both implementations and tests) to SQLAlchemy 1.4+

### 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.

Closes: #1358
Pull-request: https://github.com/sqlalchemy/alembic/pull/1358
Pull-request-sha: c678a3168b790c1d97fd32ed5a3c9e1051a4d958

Change-Id: I02f4aac265a10ce601afce3c69ce99dba80490dd

20 months agoFixes: #1348 Typings for target_metadata sequence of metadatas
Iuri de Silvio [Wed, 8 Nov 2023 19:06:28 +0000 (14:06 -0500)] 
Fixes: #1348 Typings for target_metadata sequence of metadatas
<!-- Provide a general summary of your proposed changes in the Title field above -->

Ref #1348

Add `Sequence[MetaData]` typing to `target_metadata` args.

### Description
<!-- Describe your changes in detail -->

### 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: #1349
Pull-request: https://github.com/sqlalchemy/alembic/pull/1349
Pull-request-sha: 5fcdaf5a6075303b8fb14646f3b93e4c2f76a772

Change-Id: Idd341a69aa024be1f6374fc0faa6b2519ff222bd

20 months agoMerge "Do not assume that greenlet is installed" into main
mike bayer [Wed, 8 Nov 2023 15:24:41 +0000 (15:24 +0000)] 
Merge "Do not assume that greenlet is installed" into main

20 months agoAdd trove classifier for 3.11 and 3.12
Federico Caselli [Tue, 7 Nov 2023 17:59:44 +0000 (18:59 +0100)] 
Add trove classifier for 3.11 and 3.12

Change-Id: I3c662799a73c73cabfc2cc8e6bdd797ff4dec690

20 months agoDo not assume that greenlet is installed
Federico Caselli [Mon, 6 Nov 2023 21:39:02 +0000 (22:39 +0100)] 
Do not assume that greenlet is installed

Update test to take into consideration the case where greenlet is not
installed. This is to support sqlalchemy 2.1 that removes it as
required dependency

Change-Id: I50dddf76536169df8abfd70fbb9133f2b13eec3d

21 months agoFix typing of `revision` argument in "Don't Generate Empty Migrations with Autogenera...
John T. Wodder II [Fri, 27 Oct 2023 15:06:17 +0000 (11:06 -0400)] 
Fix typing of `revision` argument in "Don't Generate Empty Migrations with Autogenerate" recipe

### Description

Type-annotations were added to the "Don't Generate Empty Migrations with Autogenerate" cookbook recipe in commit 3e48ed0.  Later, in commit 222e4ba, the type of the `revision` argument to `process_revision_directives()` was changed from `tuple[str, str]` to `str | Iterable[str | None] | Iterable[str]`, but the recipe was not updated.  This PR updates the recipe so that it will type-check.

### Checklist
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.

Closes: #1340
Pull-request: https://github.com/sqlalchemy/alembic/pull/1340
Pull-request-sha: 254b4cbe06befaa61a7e11fef5020766f129c7a5

Change-Id: I1697c1d8a3965dae8e696c9f33c179d9f20ef09c

21 months agoVersion 1.12.2 placeholder
Mike Bayer [Thu, 26 Oct 2023 15:10:57 +0000 (11:10 -0400)] 
Version 1.12.2 placeholder

21 months ago- 1.12.1 rel_1_12_1
Mike Bayer [Thu, 26 Oct 2023 15:08:25 +0000 (11:08 -0400)] 
- 1.12.1

21 months agoMerge "Implement ExecuteSQLOp.to_diff_tuple" into main
mike bayer [Thu, 26 Oct 2023 14:47:27 +0000 (14:47 +0000)] 
Merge "Implement ExecuteSQLOp.to_diff_tuple" into main

21 months agoImplement ExecuteSQLOp.to_diff_tuple
Sebastian Bayer (AE/MFD2-SO) [Thu, 26 Oct 2023 13:18:48 +0000 (09:18 -0400)] 
Implement ExecuteSQLOp.to_diff_tuple

Repaired :class:`.ExecuteSQLOp` so that it can participate in "diff"
operations; while this object is typically not present in a reflected
operation stream, custom hooks may be adding this construct where it needs
to have the correct ``to_diff_tuple()`` method.  Pull request courtesy
Sebastian Bayer.

Fixes: #1335
Closes: #1336
Pull-request: https://github.com/sqlalchemy/alembic/pull/1336
Pull-request-sha: c5e217e99d0fae87ccc89fc57c71e1c07c57ea97

Change-Id: I303f1a6b1b7bad52f00c6183b77f5e7fe6d0ef37