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

21 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

21 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

21 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

21 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

21 months agoUpdate of the no-empty-migrations snippet to work with alembic check
Sebastian Bayer [Wed, 25 Oct 2023 13:26:51 +0000 (09:26 -0400)] 
Update of the no-empty-migrations snippet to work with alembic check

### Description
Update of the no-empty-migrations snippet to work with alembic check, see https://github.com/sqlalchemy/alembic/discussions/1332

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

Change-Id: Ic23efda1fc33686605ccd07437afc057cfc98574

21 months agoMerge "render .info in create_table" into main
mike bayer [Tue, 24 Oct 2023 14:42:25 +0000 (14:42 +0000)] 
Merge "render .info in create_table" into main

21 months agochangelog fix
Mike Bayer [Tue, 24 Oct 2023 12:28:39 +0000 (08:28 -0400)] 
changelog fix

Change-Id: I24e4536831e4915c2a7cfcf25b082e97bcac699b

21 months agorender .info in create_table
Mike Bayer [Thu, 19 Oct 2023 14:59:39 +0000 (10:59 -0400)] 
render .info in create_table

Fixed regression caused by :ticket:`879` released in 1.7.0 where the
".info" dictionary of ``Table`` would not render in autogenerate create
table statements.  This can be useful for custom create table DDL rendering
schemes so it is restored.

Additionally upon seeing that Rewriter is failing typing that was
just imporved in the previous commit for #1325 /
Ibfb7a57a081818c290cf0964d12a72b85c2c1983, further correct the typing
of the "revision" argument for process_revision_directives which was
still inconsistent.

Change-Id: Ifa4c7bd1b730d51629f42bc159b994f42d157c04
Fixes: #1329
21 months agomatch process_revision_directives typing to API
Mike Bayer [Tue, 17 Oct 2023 23:18:20 +0000 (19:18 -0400)] 
match process_revision_directives typing to API

Improved typing in the
:paramref:`.EnvironmentContext.configure.process_revision_directives`
callable to better indicate that the passed-in type is
:class:`.MigrationScript`, not the :class:`.MigrationOperation` base class,
and added typing to the example at :ref:`cookbook_no_empty_migrations` to
illustrate.

Change-Id: Ibfb7a57a081818c290cf0964d12a72b85c2c1983
Fixes: #1325
21 months agoremove compare_against_backend from tests and docs
Mike Bayer [Tue, 17 Oct 2023 20:15:07 +0000 (16:15 -0400)] 
remove compare_against_backend from tests and docs

Change-Id: I6f480711ec94cd4113d3f0ca114d143b49b8d869
Fixes: #1293
22 months agoapply PG ddl paren rules to index expressions
Mike Bayer [Thu, 12 Oct 2023 17:29:58 +0000 (13:29 -0400)] 
apply PG ddl paren rules to index expressions

Fixed autogen render issue where expressions inside of indexes for PG need
to be double-parenthesized, meaning a single parens must be present within
the generated ``text()`` construct.

Change-Id: Iaf88ce28612707994a4753ee57384a8bb26f1133
Fixes: #1322
22 months agoimprove changelog
Mike Bayer [Sat, 16 Sep 2023 21:31:19 +0000 (17:31 -0400)] 
improve changelog

Change-Id: I342dbecf4fe9d9fef89b1dda531cad7693ced930

22 months agoMerge "Improve typing of `op.execute`" into main
mike bayer [Sat, 16 Sep 2023 21:29:48 +0000 (21:29 +0000)] 
Merge "Improve typing of `op.execute`" into main

22 months agofix(command): `init --package` status display (#1312)
Bryan不可思议 [Thu, 14 Sep 2023 21:23:38 +0000 (05:23 +0800)] 
fix(command): `init --package` status display (#1312)

22 months agoImprove typing of `op.execute`
Mihail Milushev [Thu, 31 Aug 2023 20:02:22 +0000 (16:02 -0400)] 
Improve typing of `op.execute`

Update type annotation for `sqltext` argument of `op.execute` to support
all the documented acceptable types.
Add unit tests for `str` and `TextClause` use cases for `sqltext` argument.
Small repetition cleanup of documentation.

Fixes: #1277
Fixes: #1058
Closes: #1278
Pull-request: https://github.com/sqlalchemy/alembic/pull/1278
Pull-request-sha: c506f99d3b26d55cbc42ae34f55dfdbcd33af234

Change-Id: I405d968d7349760d99f86d846173e75e9f61d908

23 months agoSpelling fixes (#1310)
Josh Soref [Mon, 11 Sep 2023 17:43:22 +0000 (13:43 -0400)] 
Spelling fixes (#1310)

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Federico Caselli <CaselIT@users.noreply.github.com>
23 months agoMerge "adapt identity logic to support dialect kwags" into main
mike bayer [Fri, 8 Sep 2023 12:58:01 +0000 (12:58 +0000)] 
Merge "adapt identity logic to support dialect kwags" into main

23 months agoMerge "Improve typings" into main
mike bayer [Fri, 8 Sep 2023 12:56:34 +0000 (12:56 +0000)] 
Merge "Improve typings" into main

23 months agoImprove typings
Federico Caselli [Thu, 31 Aug 2023 21:25:04 +0000 (23:25 +0200)] 
Improve typings

Misc changes to improve the typing of alembic:
- Improve typing of the revision parameter in various command functions.
- Properly type the :paramref:`.Operations.create_check_constraint.condition`
  parameter of :meth:`.Operations.create_check_constraint` to accept boolean
  expressions.

Fixes: #930
Fixes: #1266
Change-Id: I9e8249bbd34f9f0b388b79e75b76e75f8347d8ee

23 months agosetup.cfg Project Links: added Changelog + reorder (#1309)
Jan Vlčinský [Wed, 6 Sep 2023 19:15:28 +0000 (21:15 +0200)] 
setup.cfg Project Links: added Changelog + reorder (#1309)

This shall result in alembing on pypi.org showing Changelog in the
Project links section.

23 months agoadapt identity logic to support dialect kwags
Federico Caselli [Thu, 10 Aug 2023 21:54:43 +0000 (23:54 +0200)] 
adapt identity logic to support dialect kwags

Alembic now accommodates for Sequence and Identity that support dialect kwargs.
This is a change that will be added to SQLAlchemy v2.1.

Fixes: #1304
Change-Id: I68d46426296931dee68eeb909cbe17d1c48a5899

23 months agoVersion 1.12.1 placeholder
Mike Bayer [Thu, 31 Aug 2023 17:27:37 +0000 (13:27 -0400)] 
Version 1.12.1 placeholder

23 months ago- 1.12.0 rel_1_12_0
Mike Bayer [Thu, 31 Aug 2023 17:23:51 +0000 (13:23 -0400)] 
- 1.12.0

23 months agoupdate changelog version
Mike Bayer [Thu, 31 Aug 2023 14:36:05 +0000 (10:36 -0400)] 
update changelog version

Change-Id: Icf0455afff849d4681cc9a42eb7e001701670f57

23 months agoAllow passoing ExcludeConstraint to DropConstraint.from_constraint
d3 [Tue, 29 Aug 2023 11:27:04 +0000 (07:27 -0400)] 
Allow passoing ExcludeConstraint to DropConstraint.from_constraint

Added support for ``op.drop_constraint()`` to support PostrgreSQL
``ExcludeConstraint`` objects, as well as other constraint-like objects
that may be present in third party dialects, by resolving the ``type_``
parameter to be ``None`` for this case.   Autogenerate has also been
enhanced to exclude the ``type_`` parameter from rendering within this
command when  ``type_`` is ``None``.  Pull request courtesy David Hills.

Fixes: #1300
Closes: #1301
Pull-request: https://github.com/sqlalchemy/alembic/pull/1301
Pull-request-sha: b8643d19ab1930554e1137b64ffea8b8e2c74ec7

Change-Id: I25599d24a8bba455ab1d9b88843d8d84627a72d5

23 months agoAdd `match` keyword argument to rendering of foreign key constraints
Asib Kamalsada [Fri, 25 Aug 2023 13:13:30 +0000 (09:13 -0400)] 
Add `match` keyword argument to rendering of foreign key constraints

Fixed issue where the ``ForeignKeyConstraint.match`` parameter would not be
rendered in autogenerated migrations.  Pull request courtesy Asib
Kamalsada.

Fixes: #1302
Closes: #1303
Pull-request: https://github.com/sqlalchemy/alembic/pull/1303
Pull-request-sha: bd7ae16d77385b1cc00d4339f0debb0c73ce5509

Change-Id: I58ca50b7d04f0ae3dba7bf55ca3242646ae6cb1c

23 months agoMerge "Implement new `exec` write-hook runner that will execute arbitrary binaries...
mike bayer [Wed, 23 Aug 2023 15:28:52 +0000 (15:28 +0000)] 
Merge "Implement new `exec` write-hook runner that will execute arbitrary binaries" into main

23 months agoImplement new `exec` write-hook runner that will execute arbitrary binaries
Mihail Milushev [Tue, 22 Aug 2023 18:07:30 +0000 (14:07 -0400)] 
Implement new `exec` write-hook runner that will execute arbitrary binaries

Added new feature to the "code formatter" function which allows standalone
executable tools to be run against code, without going through the Python
interpreter.  Known as the ``exec`` runner, it complements the existing
``console_scripts`` runner by allowing non-Python tools such as ``ruff`` to
be used.   Pull request courtesy Mihail Milushev.

Fixes: #1275
Closes: #1276
Pull-request: https://github.com/sqlalchemy/alembic/pull/1276
Pull-request-sha: 24e576b9d8aa0d3931f2b0c0c15bb370577d7485

Change-Id: Ie28f2b7faf2fb8493c8e704f51e3e3524982e346

23 months agoMerge "Enable compare type by default" into main
mike bayer [Wed, 23 Aug 2023 15:01:31 +0000 (15:01 +0000)] 
Merge "Enable compare type by default" into main

23 months agoimplement revision_environment for merge
Mike Bayer [Tue, 22 Aug 2023 19:39:38 +0000 (15:39 -0400)] 
implement revision_environment for merge

Fixed issue where the ``revision_environment`` directive in ``alembic.ini``
was ignored by the ``alembic merge`` command, leading to issues when other
configurational elements depend upon ``env.py`` being invoked within the
command.

Change-Id: Ifc6e2ae2197f61b8415cb0460854cc74ff9dc4cd
Fixes: #1299
23 months agoEnable compare type by default
Federico Caselli [Fri, 11 Aug 2023 21:05:50 +0000 (23:05 +0200)] 
Enable compare type by default

Change the default value of :paramref:`.EnvironmentContext.configure.compare_type`
to ``True``.

Fixes: #1248
Change-Id: I6fd93de73f3b239dffddec98008083c10e154334

23 months agoVersion 1.11.4 placeholder
Mike Bayer [Wed, 16 Aug 2023 16:51:40 +0000 (12:51 -0400)] 
Version 1.11.4 placeholder

23 months ago- 1.11.3 rel_1_11_3
Mike Bayer [Wed, 16 Aug 2023 16:49:05 +0000 (12:49 -0400)] 
- 1.11.3

23 months agoSpecify `"locale"` encoding when reading configuration file
Kevin Kirsche [Fri, 11 Aug 2023 14:06:36 +0000 (10:06 -0400)] 
Specify `"locale"` encoding when reading configuration file

Added ``encoding="locale"`` setting to the use of Python's
``ConfigParser.read()``, so that a warning is not generated when using the
recently added Python feature ``PYTHONWARNDEFAULTENCODING`` specified in
:pep:`597`. The encoding is passed as the ``"locale"`` string under Python
3.10 and greater, which indicates that the system-level locale should be
used, as was the case already here.  Pull request courtesy Kevin Kirsche.

Fixes: #1273
Closes: #1274
Pull-request: https://github.com/sqlalchemy/alembic/pull/1274
Pull-request-sha: d0abd33845754827b8ce69ba1360989c7c57fdb6

Change-Id: I75c1237ba8bd2e38890d0e5e4a578a6ca0b24883

23 months agofix typos
Mike Bayer [Wed, 16 Aug 2023 15:25:30 +0000 (11:25 -0400)] 
fix typos

Change-Id: I1ffb5c6abfa3768d2e76d88b4d91f899c18a3ff2

2 years agoRemove old version notes, prior to version 1.7
Federico Caselli [Sat, 12 Aug 2023 19:40:45 +0000 (21:40 +0200)] 
Remove old version notes, prior to version 1.7

This also removes some old docs regarding sqlalchemy version prior to version 1

Change-Id: If983df98c07d4a0a6492c151b407b735b74780dc

2 years agofix stub test requirement
Federico Caselli [Fri, 11 Aug 2023 21:06:13 +0000 (23:06 +0200)] 
fix stub test requirement

Change-Id: I240a2db1fbfa7ed806d729e4ec93ec5030bc373c

2 years agoFix autogenerate issue in nulls not distinct
Federico Caselli [Tue, 8 Aug 2023 20:32:59 +0000 (22:32 +0200)] 
Fix autogenerate issue in nulls not distinct

Fixed issue with ``NULLS NOT DISTINCT`` detection in postgresql that
would keep detecting changes in the index or unique constraint.

Fixes: #1291
Change-Id: Ibb3872e8d01020fa31e85fb8aed50b84541466bf

2 years agoMerge "Improve index autogenerare detection on PostgreSQL" into main
mike bayer [Thu, 10 Aug 2023 15:48:27 +0000 (15:48 +0000)] 
Merge "Improve index autogenerare detection on PostgreSQL" into main

2 years agomention autogenerate 3rd party libraries
Federico Caselli [Wed, 9 Aug 2023 19:48:43 +0000 (21:48 +0200)] 
mention autogenerate 3rd party libraries

References: #278
Change-Id: I5bdf36bad726b06b906a784a37c6954bfc703036

2 years agoImprove index autogenerare detection on PostgreSQL
Federico Caselli [Mon, 17 Jul 2023 20:45:00 +0000 (22:45 +0200)] 
Improve index autogenerare detection on PostgreSQL

Improved autogenerate compare of expression based indexes on PostgreSQL
to produce fewer wrong detections.

Fixes: #1270
Change-Id: I468e27c6311c5449adfb92d0da07180b1c11cdd6

2 years agoImprove changelog for sort option detection in postgresql.
Federico Caselli [Tue, 8 Aug 2023 19:59:55 +0000 (21:59 +0200)] 
Improve changelog for sort option detection in postgresql.

References: #1285
Change-Id: I957d714b7cf721a84e3776eab28c1799faf5f7cc

2 years agoVersion 1.11.3 placeholder
Mike Bayer [Fri, 4 Aug 2023 13:57:00 +0000 (09:57 -0400)] 
Version 1.11.3 placeholder

2 years ago- 1.11.2 rel_1_11_2
Mike Bayer [Fri, 4 Aug 2023 13:54:59 +0000 (09:54 -0400)] 
- 1.11.2

2 years agoAdded parameters if_exists and if_not_exists for index operations.
Адриан Максим Александрович [Tue, 11 Jul 2023 19:31:29 +0000 (15:31 -0400)] 
Added parameters if_exists and if_not_exists for index operations.

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

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

As mentioned in #151, IF EXISTS/IF NOT EXISTS syntax was implemented in SQLAlchemy 2.0. This request adds an ability to use them for index operations.

If the issue implies to implement all the possible cases with these directives, I could continue working on 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
- [ ] 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: #1260
Pull-request: https://github.com/sqlalchemy/alembic/pull/1260
Pull-request-sha: 5ed62d17c349dc175521993c5a62b842f6ac624d

Change-Id: Ic0fec21e20d4a868e9e29275e540f3e09918d1ff

2 years agoMerge "Nulls not distinct support in postgresql" into main
mike bayer [Mon, 26 Jun 2023 19:01:48 +0000 (19:01 +0000)] 
Merge "Nulls not distinct support in postgresql" into main

2 years agoNulls not distinct support in postgresql
Federico Caselli [Thu, 8 Jun 2023 19:32:11 +0000 (15:32 -0400)] 
Nulls not distinct support in postgresql

Added support in autogenerate for NULLS NOT DISTINCT in
the PostgreSQL dialect.

Closes: #1249
Pull-request: https://github.com/sqlalchemy/alembic/pull/1249
Pull-request-sha: e4a7ffed54677d5aba9ab0251026a8a2a0e71278

Change-Id: I299a24fa7af4ae9387d6b48ce49fb516dfb84518

2 years agoFixed CLI output when running post_write hooks
Mathieu Défosse [Sat, 17 Jun 2023 17:46:08 +0000 (13:46 -0400)] 
Fixed CLI output when running post_write hooks

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

### Description
Just fixed badly written Python string interpolation. Used the `%` operator just like the lines above.

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

Change-Id: I89ef873935d7206a61f78a09139cd5ab192a2275

2 years agoUpdate black
Federico Caselli [Thu, 8 Jun 2023 19:42:44 +0000 (21:42 +0200)] 
Update black

Change-Id: I836b9a322819c07ec202fdcca4fd52818b994bff

2 years agoAdded typing to the default script mako templates.
Federico Caselli [Fri, 26 May 2023 20:01:48 +0000 (22:01 +0200)] 
Added typing to the default script mako templates.

Fixes: #1253
Change-Id: I00cae5daa8ebe9ba36bfac3af485a0e45a39f923

2 years agoVersion 1.11.2 placeholder
Mike Bayer [Wed, 17 May 2023 22:09:45 +0000 (18:09 -0400)] 
Version 1.11.2 placeholder

2 years ago- 1.11.1 rel_1_11_1
Mike Bayer [Wed, 17 May 2023 22:06:56 +0000 (18:06 -0400)] 
- 1.11.1

2 years agotypos
Mike Bayer [Wed, 17 May 2023 22:06:27 +0000 (18:06 -0400)] 
typos

Change-Id: I3946d5afc0fb876424659356a6b0e49f3ee5a8bc

2 years agoMerge "Define type for generic classes" into main
mike bayer [Wed, 17 May 2023 15:15:05 +0000 (15:15 +0000)] 
Merge "Define type for generic classes" into main

2 years agoMerge "restore drop_index.table_name, drop_constraint.type_ as positional" into main
mike bayer [Wed, 17 May 2023 13:12:43 +0000 (13:12 +0000)] 
Merge "restore drop_index.table_name, drop_constraint.type_ as positional" into main

2 years agoDefine type for generic classes
Federico Caselli [Tue, 16 May 2023 19:52:02 +0000 (21:52 +0200)] 
Define type for generic classes

Fixed typing use of :class:`~sqlalchemy.schema.Column` and other
generic SQLAlchemy classes.

Fixes: #1246
Change-Id: I5ee80395d626894a52e3395c9986213289576355

2 years agorestore drop_index.table_name, drop_constraint.type_ as positional
Mike Bayer [Tue, 16 May 2023 12:55:51 +0000 (08:55 -0400)] 
restore drop_index.table_name, drop_constraint.type_ as positional

These two API changes were identified as having legacy
use patterns and should be revisited using a deprecation warning
for removal in either 1.12 or 1.13.

Add documentation re: Alembic not using semver, fix
incorrect calling signature example in batch documentation.

Change-Id: I33dc5a8d058bcce77591bb037ae964e626a3387f
Fixes: #1243
Fixes: #1245
2 years agorestore Dict[str, str] as potential get_section() type
Mike Bayer [Tue, 16 May 2023 14:39:31 +0000 (10:39 -0400)] 
restore Dict[str, str] as potential get_section() type

Restored the output type of :meth:`.Config.get_section` to include
``Dict[str, str]`` as a potential return type, which had been changed to
immutable ``Mapping[str, str]``. When a section is returned and the default
is not used, a mutable dictionary is returned.

Change-Id: I6e2c67f00222d7a2b388f9294c5336fd8e2dec94
Fixes: #1244
2 years agoVersion 1.11.1 placeholder
Mike Bayer [Mon, 15 May 2023 19:46:46 +0000 (15:46 -0400)] 
Version 1.11.1 placeholder

2 years ago- 1.11.0 rel_1_11_0
Mike Bayer [Mon, 15 May 2023 19:44:58 +0000 (15:44 -0400)] 
- 1.11.0

2 years ago1.11.0 in changelog file; doc updates
Mike Bayer [Mon, 15 May 2023 19:19:11 +0000 (15:19 -0400)] 
1.11.0 in changelog file; doc updates

Change-Id: I5098f9fe2bf57ad93f400e34d914ae0e3b45c747

2 years agoMerge "dont compare unique constraint and index sigs to each other" into main
mike bayer [Fri, 12 May 2023 21:15:55 +0000 (21:15 +0000)] 
Merge "dont compare unique constraint and index sigs to each other" into main

2 years agoImprove commit 497c6c86b9547eed2ac297b1618300430578b86f
Federico Caselli [Fri, 12 May 2023 19:59:15 +0000 (21:59 +0200)] 
Improve commit 497c6c86b9547eed2ac297b1618300430578b86f

Follow up of I91b453c8848dc5d24d63840bfd7ce4d22dd0e693 to improve some
leftover changes.

Change-Id: I368b93df4d8bd6782b04042ab7872276ff00e56b

2 years agodont compare unique constraint and index sigs to each other
Mike Bayer [Fri, 12 May 2023 16:40:01 +0000 (12:40 -0400)] 
dont compare unique constraint and index sigs to each other

Fixed regression caused by :ticket:`1166` released in version 1.10.0 which
caused MySQL unique constraints with multiple columns to not compare
correctly within autogenerate, due to different sorting rules on unique
constraints vs. indexes, which in MySQL are shared constructs.

Change-Id: I5687dde95281f237fd73367d145b9c62e2576a3a
Fixes: #1240
2 years agoMerge "add user_module_prefix param for render_python_code" into main
mike bayer [Fri, 12 May 2023 16:59:33 +0000 (16:59 +0000)] 
Merge "add user_module_prefix param for render_python_code" into main

2 years agoMerge "Added ``op.run_async``." into main
mike bayer [Fri, 12 May 2023 16:59:04 +0000 (16:59 +0000)] 
Merge "Added ``op.run_async``." into main

2 years agoadd user_module_prefix param for render_python_code
tangkikodo [Thu, 11 May 2023 20:43:05 +0000 (16:43 -0400)] 
add user_module_prefix param for render_python_code

Fixed issue where :func:`.autogenerate.render_python_code` function did not
provide a default value for the ``user_module_prefix`` variable, leading to
``NoneType`` errors when autogenerate structures included user-defined
types. Added new parameter
:paramref:`.autogenerate.render_python_code.user_module_prefix` to allow
this to be set as well as to default to ``None``. Pull request courtesy
tangkikodo.

Fixes #1235
Closes: #1233
Pull-request: https://github.com/sqlalchemy/alembic/pull/1233
Pull-request-sha: 6fa3bc1ce4f2130bf7a28282a84e3bb9a3223304

Change-Id: Ic21eec87f373a9518513a6a308f16e5d2b5ebf81

2 years agoAdded ``op.run_async``.
Federico Caselli [Sat, 29 Apr 2023 21:25:21 +0000 (23:25 +0200)] 
Added ``op.run_async``.

Added :meth:`.Operations.run_async` to the operation module to allow
running async functions in the ``upgrade`` or ``downgrade`` migration
function when running alembic using an async dialect.
This function will receive as first argument an
class:`~sqlalchemy.ext.asyncio.AsyncConnection` sharing the transaction
used in the migration context.

also restore the .execute() method to BatchOperations

Fixes: #1231
Change-Id: I3c3237d570be3c9bd9834e4c61bb3231bfb82765

2 years agoMerge "keyword only arguments in ops" into main
mike bayer [Fri, 12 May 2023 16:00:07 +0000 (16:00 +0000)] 
Merge "keyword only arguments in ops" into main

2 years agoRemoved server default quoting from compare
Federico Caselli [Thu, 11 May 2023 19:49:14 +0000 (21:49 +0200)] 
Removed server default quoting from compare

Don't modify the metadata server default when comparing it in the
autogenerate process.
This impacts the value passes to user provided functions passed in
:paramref:`.EnvironmentContext.configure.compare_server_default`
and third party dialect that implement a custom ``compare_server_default``.

Fixes: #1178
Change-Id: Ib429efcf9077337f768ad5aad91659867e89391a

2 years agokeyword only arguments in ops
Mike Bayer [Fri, 25 Nov 2022 15:31:20 +0000 (10:31 -0500)] 
keyword only arguments in ops

Argument signatures of Alembic operations now enforce keyword-only
arguments as passed as keyword and not positionally, such as
:paramref:`.Operations.create_table.schema`,
:paramref:`.Operations.add_column.type_`, etc.

Change-Id: I91b453c8848dc5d24d63840bfd7ce4d22dd0e693
Fixes: #1130
2 years agoMerge "Fix compat issue with older SQLAlchemy versions." into main
mike bayer [Tue, 9 May 2023 23:36:42 +0000 (23:36 +0000)] 
Merge "Fix compat issue with older SQLAlchemy versions." into main

2 years agoFix compat issue with older SQLAlchemy versions.
Federico Caselli [Mon, 8 May 2023 21:05:40 +0000 (23:05 +0200)] 
Fix compat issue with older SQLAlchemy versions.

Added placeholder classes for ``Computed`` and ``Identity`` when older 1.x
SQLAlchemy versions are in use, namely prior to SQLAlchemy 1.3.11 when the
``Computed`` construct was introduced. Previously these were set to None,
however this could cause issues with certain codepaths that were using
``isinstance()`` such as one within "batch mode".

Fixes: #1237
Change-Id: I033712158baa68cca6a56bd41d0636109e156b86

2 years agoAdd Operations and BatchOperations stub methods
CaselIT [Thu, 16 Mar 2023 23:50:53 +0000 (00:50 +0100)] 
Add Operations and BatchOperations stub methods

Updated stub generator script to also add stubs method definitions
for the :class:`.Operations` class and the :class:`.BatchOperations`
class obtained from :meth:`.Operations.batch_alter_table`.

Repaired the return signatures for :class:`.Operations` that mostly
return ``None``, and were erroneously referring to ``Optional[Table]``
in many cases.

Fixes: #1093
Change-Id: I98d38dd5a1e719b4dbbc1003746ec28f26c27808

2 years agoMerge "Added quiet option to command line" into main
Federico Caselli [Thu, 4 May 2023 20:21:28 +0000 (20:21 +0000)] 
Merge "Added quiet option to command line" into main

2 years agoMerge "Fix ExcludeConstraint with func." into main
mike bayer [Wed, 3 May 2023 13:19:07 +0000 (13:19 +0000)] 
Merge "Fix ExcludeConstraint with func." into main

2 years agoMerge "Replace find with find_namespace in setuptools config." into main
mike bayer [Sun, 30 Apr 2023 14:44:01 +0000 (14:44 +0000)] 
Merge "Replace find with find_namespace in setuptools config." into main

2 years agodocument constraint behavior for add_column()
Mike Bayer [Sat, 29 Apr 2023 04:32:16 +0000 (00:32 -0400)] 
document constraint behavior for add_column()

note which constraints are generated from Column (nullable,
single column FOREIGN KEY) and which
are not (PRIMARY KEY, CHECK, UNIQUE, etc.).

Change-Id: I030f2b4e17b08a63e0543567cf01ba03e8752d79
Fixes: #1232
2 years agoAdded quiet option to command line
CaselIT [Sun, 2 Apr 2023 10:21:00 +0000 (12:21 +0200)] 
Added quiet option to command line

Added quiet option to the command line, using the ``-q/--quiet``
option. This flag will prevent alembic from logging anything
to stdout.

Fixes: #1109
Change-Id: I7d9fac05d93e07efaefd87a582a7e785891798ef

2 years agoFix ExcludeConstraint with func.
Federico Caselli [Fri, 28 Apr 2023 19:24:43 +0000 (21:24 +0200)] 
Fix ExcludeConstraint with func.

Fix autogenerate issue with PostgreSQL :class:`.ExcludeConstraint`
that included sqlalchemy functions. The function text was previously
rendered as a plain string without surrounding with ``text()``.

Fixes: #1230
Change-Id: I0d59e04d5a64132ed86f92a27e4247ac9703f3e0

2 years agoFollowup / fixup: apply 'black' code formatting to a couple of missed docstrings
James Addison [Wed, 26 Apr 2023 20:29:53 +0000 (16:29 -0400)] 
Followup / fixup: apply 'black' code formatting to a couple of missed docstrings

### Description
Follow-up / completion of #1220.  That change updated a number of docstrings within the codebase to use standardised `black` code formatting, but a couple of locations had been missed.

### Checklist

This pull request is:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed

Closes: #1228
Pull-request: https://github.com/sqlalchemy/alembic/pull/1228
Pull-request-sha: f5696b9ca34998e22af5705434ed2393d86e82c0

Change-Id: I5d935b036d6f4e11eb5c229f9982db587d67ae24

2 years agoConsistency: apply codestyle formatting to docstring code snippets
James Addison [Thu, 13 Apr 2023 19:11:01 +0000 (15:11 -0400)] 
Consistency: apply codestyle formatting to docstring code snippets

### Description
This is a pedantic/consistency follow-up from #1219: that change applied some `black` formatting to two code snippets, and this change applies that formatting to the remaining snippets in the codebase.

For each snippet, I extracted the code and applied formatting using `black` v23.1.0, then placed the results back into the source.

In one case there was an associated 'output' block, and in that case I re-ran the snippet code to update the results of that output too (this included a [change-in-output](https://github.com/sqlalchemy/alembic/compare/main...openculinary:alembic:docstrings/snippet-format-consistency?expand=1#diff-bf4756660cdb31ee8566a2cff72526671356c38a725195723ce0e65e6c11e6cfR124) thanks to a [bugfix since the snippet was written](https://github.com/sqlalchemy/alembic/commit/bc6971aa4abdafb7e1a1123c26a373cc25a34ca9), by the looks of it).

### Checklist

This pull request is:

- [x] A documentation / typographical error fix

Closes: #1220
Pull-request: https://github.com/sqlalchemy/alembic/pull/1220
Pull-request-sha: cd65a453192546a660d6f5ebad5af08bb1c72af4

Change-Id: I6758445633c364c8fb2f4d8376d83607430a36d6

2 years agoMerge "Improve typing." into main
mike bayer [Tue, 25 Apr 2023 16:42:38 +0000 (16:42 +0000)] 
Merge "Improve typing." into main

2 years agoReplace find with find_namespace in setuptools config.
Federico Caselli [Mon, 24 Apr 2023 20:26:38 +0000 (22:26 +0200)] 
Replace find with find_namespace in setuptools config.

This removes a warning from setuptools

Fixes: #1227
Change-Id: I81187e86038836ded39140076f25dc5f6bc1eb35