]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
3 years agoDo not tag wheel as being compatible with Python 2
layday [Mon, 30 Aug 2021 17:30:05 +0000 (13:30 -0400)] 
Do not tag wheel as being compatible with Python 2

Corrected "universal wheel" directive in setup.cfg so that building a wheel
does not target Python 2. The PyPi files index for 1.7.0 was corrected
manually. Pull request courtesy layday.

Fixes: #893
Closes: #894
Pull-request: https://github.com/sqlalchemy/alembic/pull/894
Pull-request-sha: 577afdbe5906247493182df95fe5e5338ac23080

Change-Id: I26ca6d9e3e8064d22713926707a53cb57a69d8e7

3 years agoVersion 1.7.1 placeholder
Mike Bayer [Mon, 30 Aug 2021 15:12:17 +0000 (11:12 -0400)] 
Version 1.7.1 placeholder

3 years ago- 1.7.0 rel_1_7_0
Mike Bayer [Mon, 30 Aug 2021 15:02:39 +0000 (11:02 -0400)] 
- 1.7.0

3 years agobump importlib.resources req to 3.9
Mike Bayer [Fri, 27 Aug 2021 16:38:16 +0000 (12:38 -0400)] 
bump importlib.resources req to 3.9

The importlib.resources.files() API was not added until 3.9.

Change-Id: I62ef8974d6637394448346d7e0f86c6dd93f81a7

3 years agochangelog updates
Mike Bayer [Thu, 26 Aug 2021 22:37:35 +0000 (18:37 -0400)] 
changelog updates

Change-Id: I84519c685e2f0a7ac84fe866f33a8451cfc495e2

3 years agodecouple pyproject.toml from the test suite
Mike Bayer [Thu, 26 Aug 2021 22:25:29 +0000 (18:25 -0400)] 
decouple pyproject.toml from the test suite

tools/write_pyi.py is run as part of the test suite,
which has to run from a source distribution, which
does not have pyproject.toml right now due to
issues reported w/ pip.  these pip issues are probably
resolved now however we have not gone back to including
pyproject.toml at the moment.   so we therefore have to
hardcode the single "-l79" black config option in
write_pyi.py.

Change-Id: I877f69eb2322f6cbb39ed4c6d4a9adf598703223

3 years agoalso include py.typed
Mike Bayer [Thu, 26 Aug 2021 22:16:09 +0000 (18:16 -0400)] 
also include py.typed

Change-Id: I8f41eeaf517dfb52f1ddad0a3735f61545bea205

3 years agoadjust manifest to accommodate .pyi files
Mike Bayer [Thu, 26 Aug 2021 21:55:15 +0000 (17:55 -0400)] 
adjust manifest to accommodate .pyi files

Change-Id: I51c7c04c609dd008921e803596c53a48c8b247c0

3 years agoMerge "Add test to ensure method given in #880 works"
mike bayer [Wed, 25 Aug 2021 18:22:21 +0000 (18:22 +0000)] 
Merge "Add test to ensure method given in #880 works"

3 years agoAdd test to ensure method given in #880 works
Mike Bayer [Tue, 24 Aug 2021 15:02:52 +0000 (11:02 -0400)] 
Add test to ensure method given in #880 works

Change-Id: I05dae157320be49eb598084388196e72896bc89d
Fixes: #880
3 years agoMerge "remove dependency on pkg_resources"
mike bayer [Wed, 25 Aug 2021 17:26:49 +0000 (17:26 +0000)] 
Merge "remove dependency on pkg_resources"

3 years agoMerge "support named CHECK constraints in batch"
mike bayer [Tue, 24 Aug 2021 14:45:37 +0000 (14:45 +0000)] 
Merge "support named CHECK constraints in batch"

3 years agosupport named CHECK constraints in batch
Mike Bayer [Mon, 23 Aug 2021 17:31:57 +0000 (13:31 -0400)] 
support named CHECK constraints in batch

Named CHECK constraints are now supported by batch mode, and will
automatically be part of the recreated table assuming they are named. They
also can be explicitly dropped using ``op.drop_constraint()``. For
"unnamed" CHECK constraints, these are still skipped as they cannot be
distinguished from the CHECK constraints that are generated by the
``Boolean`` and ``Enum`` datatypes.

Note that this change may require adjustments to migrations that drop or
rename columns which feature an associated named check constraint, such
that an additional ``op.drop_constraint()`` directive should be added for
that named constraint as there will no longer be an associated column
for it; for the ``Boolean`` and ``Enum`` datatypes, an ``existing_type``
keyword may be passed to ``BatchOperations.drop_constraint`` as well.

Fixes: #884
Change-Id: I3694430f7c9735bcc3b0765893b333cc8e0d1cd3

3 years agoappend the path to write_pyi script.
CaselIT [Mon, 23 Aug 2021 22:14:58 +0000 (00:14 +0200)] 
append the path to write_pyi script.

This allows running without having alembic installed

Change-Id: I1cc4f108916233e7b149485a42cae759e7e3b577

3 years agoremove dependency on pkg_resources
Mike Bayer [Mon, 23 Aug 2021 20:24:26 +0000 (16:24 -0400)] 
remove dependency on pkg_resources

The dependency on ``pkg_resources`` which is part of ``setuptools`` has
been removed, so there is no longer any runtime dependency on
``setuptools``. The functionality has been replaced with
``importlib.metadata`` and ``importlib.resources`` which are both part of
Python std.lib, or via pypy dependency ``importlib-metadata`` for Python
version < 3.8 and ``importlib-resources`` for Python version < 3.7.

Change-Id: I7802fe72ff644f52ae2edde53bc8e16f016b7c45
Fixes: #885
3 years agoavoid importing ForwardRef that's py3.9+ only
CaselIT [Mon, 23 Aug 2021 18:54:00 +0000 (20:54 +0200)] 
avoid importing ForwardRef that's py3.9+ only

Change-Id: I76654f10e208d618e21ab0c884cb0abede4d6177

3 years agoMerge "Fix postgresql_include in create_index"
mike bayer [Mon, 23 Aug 2021 18:19:16 +0000 (18:19 +0000)] 
Merge "Fix postgresql_include in create_index"

3 years agoFix postgresql_include in create_index
Steven Bronson [Thu, 19 Aug 2021 16:06:25 +0000 (12:06 -0400)] 
Fix postgresql_include in create_index

Fixed issue where usage of the PostgreSQL ``postgresql_include`` option
within a :meth:`.Operations.create_index` would raise a KeyError, as the
additional column(s) need to be added to the table object used by the
construct internally. The issue is equivalent to the SQL Server issue fixed
in :ticket:`513`. Pull request courtesy Steven Bronson.

Copied from e01041b and 174cb4b.

Fixes: #874
Closes: #875
Pull-request: https://github.com/sqlalchemy/alembic/pull/875
Pull-request-sha: 2f9b51890a1296146bcea842dc8bbee53d1d11f5

Change-Id: I68cc2a75dafd3297c5121c5125ff9c463c74f777

3 years agogenerate .pyi files for proxied classes
Mike Bayer [Wed, 11 Aug 2021 19:58:16 +0000 (15:58 -0400)] 
generate .pyi files for proxied classes

Stub .pyi files have been added for the "dynamically"
generated Alembic modules ``alembic.op`` and ``alembic.context``, which
include complete function signatures and docstrings, so that the functions
in these namespaces will have both IDE support (vscode, pycharm, etc) as
well as support for typing tools like Mypy. The files themselves are
statically generated from their source functions within the source tree.

Still not available is sphinx autodoc from the .pyi file.  so
we might want to further modify this to write into the .py directly.

if we do *that*, we could almost get rid of ModuleClsProxy and
just generate proxying methods fully in op.py.  however, this won't work
for the "extending ops" use case.

Change-Id: I3f084040de25ed3f8e92a4e9d0bb83d69b78eac6

3 years agoAdd pep-484 type annotations
CaselIT [Sun, 18 Apr 2021 13:44:50 +0000 (15:44 +0200)] 
Add pep-484 type annotations

pep-484 type annotations have been added throughout the library. This
should be helpful in providing Mypy and IDE support, however there is not
full support for Alembic's dynamically modified "op" namespace as of yet; a
future release will likely modify the approach used for importing this
namespace to be better compatible with pep-484 capabilities.

Type originally created using MonkeyType

Add types extracted with the MonkeyType https://github.com/instagram/MonkeyType
library by running the unit tests using ``monkeytype run -m pytest tests``, then
``monkeytype apply <module>`` (see below for further details).
USed MonkeyType version 20.5 on Python 3.8, since newer version have issues

After applying the types, the new imports are placed in a ``TYPE_CHECKING`` guard
and all type definition of non base types are deferred by using the string notation.

NOTE: since to apply the types MonkeType need to import the module, also the test
ones, the patch below mocks the setup done by pytest so that the tests could be
correctly imported

diff --git a/alembic/testing/__init__.py b/alembic/testing/__init__.py
index bdd1746..b1090c7 100644

Change-Id: Iff93628f4b43c740848871ce077a118db5e75d41
--- a/alembic/testing/__init__.py
+++ b/alembic/testing/__init__.py
@@ -9,6 +9,12 @@ from sqlalchemy.testing.config import combinations
 from sqlalchemy.testing.config import fixture
 from sqlalchemy.testing.config import requirements as requires

+from sqlalchemy.testing.plugin.pytestplugin import PytestFixtureFunctions
+from sqlalchemy.testing.plugin.plugin_base import _setup_requirements
+
+config._fixture_functions = PytestFixtureFunctions()
+_setup_requirements("tests.requirements:DefaultRequirements")
+
 from alembic import util
 from .assertions import assert_raises
 from .assertions import assert_raises_message

Currently I'm using this branch of the sqlalchemy stubs:
https://github.com/sqlalchemy/sqlalchemy2-stubs/tree/alembic_updates

Change-Id: I8fd0700aab1913f395302626b8b84fea60334abd

3 years agofix release num in changelog
Mike Bayer [Wed, 11 Aug 2021 15:13:46 +0000 (11:13 -0400)] 
fix release num in changelog

Change-Id: I30540e78650c038f8fd5f6c8247bac7a28495bf7

3 years agoadd req for sqlite computed columns
Mike Bayer [Tue, 10 Aug 2021 19:41:38 +0000 (15:41 -0400)] 
add req for sqlite computed columns

older Python 3.6 has a sqlite that doesn't support this

Change-Id: Ie65ef7fabeae2f5142573247548dd50d6d1708dd

3 years agoMerge "qualify sqlite batch add column for dynamic defaults"
mike bayer [Tue, 10 Aug 2021 19:32:12 +0000 (19:32 +0000)] 
Merge "qualify sqlite batch add column for dynamic defaults"

3 years agoqualify sqlite batch add column for dynamic defaults
Mike Bayer [Sat, 7 Aug 2021 15:48:19 +0000 (11:48 -0400)] 
qualify sqlite batch add column for dynamic defaults

Batch "auto" mode will now select for "recreate" if the ``add_column()``
operation is used on SQLite, and the column itself meets the criteria for
SQLite where ADD COLUMN is not allowed, in this case a functional or
parenthesized SQL expression or a ``Computed`` (i.e. generated) column.

Change-Id: Ie948b4b8ad8dc698b458403831e47bac4ad45b8a
Fixes: #883
3 years agoPreserve comment and info in Drop/CreateTableOp
Nicolas CANIART [Tue, 10 Aug 2021 14:36:55 +0000 (10:36 -0400)] 
Preserve comment and info in Drop/CreateTableOp

Fixed regression due to :ticket:`803` where the ``.info`` and ``.comment``
attributes of ``Table`` would be lost inside of the :class:`.DropTableOp`
class, which when "reversed" into a :class:`.CreateTableOp` would then have
lost these elements. Pull request courtesy Nicolas CANIART.

Fixes: #879
Closes: #881
Pull-request: https://github.com/sqlalchemy/alembic/pull/881
Pull-request-sha: e509b9e8180085998e32746721eeb9266b9f2145

Change-Id: I84a0680266fcf80f3dc922f3cbc76dabd74eedd3

4 years agoCorrect typo in documention, closes #872 873/head
Adam Parkin [Mon, 12 Jul 2021 19:39:19 +0000 (12:39 -0700)] 
Correct typo in documention, closes #872

4 years agoAdd changelog entry for test suite
Gord Thompson [Thu, 1 Jul 2021 18:09:35 +0000 (12:09 -0600)] 
Add changelog entry for test suite

Change-Id: Ibb1aba8f714bc167068a58069426591b5361bf3a

4 years agorepair py3k merge
Mike Bayer [Sat, 26 Jun 2021 14:29:43 +0000 (10:29 -0400)] 
repair py3k merge

in 79f84f71e1045aafed389e7b221 I merged without rebasing
so we missed updating the recent version_locations patch,
fix that.

also we don't need mock as a test dependency.

Change-Id: Ic2fe1db8b105c60ec51eefec7a4dc8d8c495b119

4 years agoMerge "Drop compatibility with python 2.7."
mike bayer [Sat, 26 Jun 2021 14:20:13 +0000 (14:20 +0000)] 
Merge "Drop compatibility with python 2.7."

4 years agoMerge "Support version_locations paths with spaces"
mike bayer [Wed, 23 Jun 2021 18:32:24 +0000 (18:32 +0000)] 
Merge "Support version_locations paths with spaces"

4 years agoAdd requirement to AutogenerateForeignKeysTest
gordthompson [Wed, 23 Jun 2021 12:13:02 +0000 (06:13 -0600)] 
Add requirement to AutogenerateForeignKeysTest

Change-Id: I4c4313488870f8975ced451709bd2a99fa530271

4 years agoDrop compatibility with python 2.7.
CaselIT [Sun, 18 Apr 2021 09:41:04 +0000 (11:41 +0200)] 
Drop compatibility with python 2.7.

Now alembic supports only python from version 3.6.

Change-Id: Iccf124c2d74af801d90a16c9003cdad318768625

4 years agoSupport version_locations paths with spaces
Gord Thompson [Sat, 12 Jun 2021 21:12:17 +0000 (15:12 -0600)] 
Support version_locations paths with spaces

Fixes: #842
Change-Id: Icae7899cecc137eaba26cd14ded9da89df35aae1

4 years agoUpdate README.unittests.rst re: test suite
Gord Thompson [Sun, 20 Jun 2021 19:48:59 +0000 (13:48 -0600)] 
Update README.unittests.rst re: test suite

Change-Id: Id7c0c06eb0826b50b55a4f0e18b4fbe397714a23

4 years agoImplement "test suite"
Gord Thompson [Tue, 8 Jun 2021 22:56:39 +0000 (16:56 -0600)] 
Implement "test suite"

Fixes: #855
Change-Id: I11386597d9f3a260d7349b58d276b44d78642a6a

4 years agorepair py2k support
Mike Bayer [Wed, 16 Jun 2021 17:39:03 +0000 (13:39 -0400)] 
repair py2k support

the editor patch had some py3 isms as a result of us disabling
the python 2 tests in gerrit.   need to move forward w/ the py3k
or re-enable py2k

Change-Id: If47b0ebc105131fd3e7b8e6d76e0555da1484b8c

4 years agoMerge "Revendor editor and make dateutil optional"
mike bayer [Wed, 16 Jun 2021 15:37:48 +0000 (15:37 +0000)] 
Merge "Revendor editor and make dateutil optional"

4 years agoRevendor editor and make dateutil optional
CaselIT [Tue, 15 Jun 2021 20:32:05 +0000 (22:32 +0200)] 
Revendor editor and make dateutil optional

Re-implemented the ``python-editor`` dependency as a small internal
function to avoid the need for external dependencies.
The implementation is based on the original
version in 7b91b325ff43a0e9235e0f15b57391fa92352626.

Make the ``python-dateutil`` library an optional dependency.
This library is only required if the ``timezone`` option
is used in the Alembic configuration.
An extra require named ``tz`` is available with
``pip install alembic[tz]`` to install it.

Fixes: #674
Fixes: #856
Change-Id: I07f17b2fea01e3a3d677ce95333fe3e8d8d438fd

4 years agoremove python 2 from github workflow
CaselIT [Tue, 15 Jun 2021 20:53:38 +0000 (22:53 +0200)] 
remove python 2 from github workflow

Change-Id: I7dd74078ecea74ba85cb5c0d6f78f7270ee1287f

4 years agoAdd async as template (#858)
Nurgazy Nazhimidinov [Tue, 15 Jun 2021 20:48:36 +0000 (23:48 +0300)] 
Add async as template (#858)

It seems that latest version of alembic lists `async` as template

4 years agoupdate issue template to favor discussions in most cases
Mike Bayer [Tue, 15 Jun 2021 14:19:54 +0000 (10:19 -0400)] 
update issue template to favor discussions in most cases

Change-Id: I1b6044c01c59d060395933818706ef75acc46cdb

4 years agoMinor updates to .gitignore
Gord Thompson [Thu, 3 Jun 2021 15:25:41 +0000 (09:25 -0600)] 
Minor updates to .gitignore

Change-Id: I367baf75a1ac66149264bc94ba18be0076958e95

4 years agoVersion 1.6.6 placeholder
Mike Bayer [Thu, 27 May 2021 19:50:49 +0000 (15:50 -0400)] 
Version 1.6.6 placeholder

4 years ago- 1.6.5 rel_1_6_5
Mike Bayer [Thu, 27 May 2021 19:49:10 +0000 (15:49 -0400)] 
- 1.6.5

4 years agoAdd kwargs support to DropIndexOp autogenerate render
Jet Zhou [Thu, 27 May 2021 18:26:51 +0000 (14:26 -0400)] 
Add kwargs support to DropIndexOp autogenerate render

Fixed issue where dialect-specific keyword arguments within the
:class:`.DropIndex` operation directive would not render in the
autogenerated Python code. As support was improved for adding dialect
specific arguments to directives as part of :ticket:`803`, in particular
arguments such as "postgresql_concurrently" which apply to the actual
create/drop of the index, support was needed for these to render even in a
drop index operation. Pull request courtesy Jet Zhou.

Fixes: #849
Closes: #852
Pull-request: https://github.com/sqlalchemy/alembic/pull/852
Pull-request-sha: 6392a287179ed746f709ba1e0e07ccab3ea8e4c6

Change-Id: I9b602178c32d6c6a41c0dbe0969a19bd4fa329bd

4 years agoVersion 1.6.5 placeholder
Mike Bayer [Mon, 24 May 2021 20:40:14 +0000 (16:40 -0400)] 
Version 1.6.5 placeholder

4 years ago- 1.6.4 rel_1_6_4
Mike Bayer [Mon, 24 May 2021 20:38:36 +0000 (16:38 -0400)] 
- 1.6.4

4 years agodifferentiate CreateTableOp from model vs. op.create_table()
Mike Bayer [Mon, 24 May 2021 20:14:30 +0000 (16:14 -0400)] 
differentiate CreateTableOp from model vs. op.create_table()

Fixed regression caused by just fixed :ticket:`844` that scaled back the
filter for ``unique=True/index=True`` too far such that these directives no
longer worked for the ``op.create_table()`` op, this has been fixed.

Change-Id: Idbed889ef4fbb7b3a944d3f4631f1cae53030316
Fixes: #848
4 years agoVersion 1.6.4 placeholder
Mike Bayer [Fri, 21 May 2021 20:52:56 +0000 (16:52 -0400)] 
Version 1.6.4 placeholder

4 years ago- 1.6.3 rel_1_6_3
Mike Bayer [Fri, 21 May 2021 20:48:51 +0000 (16:48 -0400)] 
- 1.6.3

4 years agoMerge "De-duplicate Revision.down_revision helpers."
mike bayer [Fri, 21 May 2021 15:32:54 +0000 (15:32 +0000)] 
Merge "De-duplicate Revision.down_revision helpers."

4 years agoDe-duplicate Revision.down_revision helpers.
Simon Bowly [Thu, 20 May 2021 21:46:04 +0000 (07:46 +1000)] 
De-duplicate Revision.down_revision helpers.

Fixes an issue when downgrading a revision where dependencies
are duplicated (e.g. by specifying the down_revision in depends_on).
This causes the down migrations to fail to remove the head, which is
caught by an assertion.

Added logic to de-duplicate the entries in _normalized_down_revisions
and _all_down_revisions without altering revision order.

This change revises the previous approach taken in
8d5a9a1b0d32fff5726010afffa48cc0fb738238 to address the problem
more generally outside of the topological algorithm.

Fixes: #843
Change-Id: I3517fb102b38c783c9a61bfb8dabc02c1fc89c4b

4 years agoMerge "Remove unique/index flags when copying table"
mike bayer [Thu, 20 May 2021 21:36:04 +0000 (21:36 +0000)] 
Merge "Remove unique/index flags when copying table"

4 years agoRemove unique/index flags when copying table
Mike Bayer [Thu, 20 May 2021 17:06:52 +0000 (13:06 -0400)] 
Remove unique/index flags when copying table

Fixed 1.6-series regression where ``UniqueConstraint`` and to a lesser
extent ``Index`` objects would be doubled up in the generated model when
the ``unique=True`` / ``index=True`` flags were used.

Change-Id: Idb21891d66cc8d46b257f53062660ce1d4825fb8
Fixes: #844
4 years agoensure heads remain unique in topological
Mike Bayer [Thu, 20 May 2021 18:17:53 +0000 (14:17 -0400)] 
ensure heads remain unique in topological

Fixed regression where a revision file that contained its own down revision
as a dependency would cause an endless loop in the traversal logic.

Change-Id: Ie8bd3b4d9f81e4bda131ffdbabe7a90c4a715054
Fixes: #843
4 years agoUpdate black, zimports and flake8
CaselIT [Wed, 12 May 2021 20:16:22 +0000 (22:16 +0200)] 
Update black, zimports and flake8

Change-Id: Ia7d0ea7cc4389bc6adc4226efd5b18ecb68ffb2b

4 years agoFixed a bug where paths defined in post-write hook options
CaselIT [Tue, 11 May 2021 18:17:00 +0000 (20:17 +0200)] 
Fixed a bug where paths defined in post-write hook options
would be wrongly escaped in non posix environment (Windows).

Fixes: #841
Change-Id: Ife74d9291523378da113c259e3c173a8bc054e47

4 years agoMerge pull request #1 from dltacube/config.py-typo 840/head
Yoni Revah [Tue, 11 May 2021 02:56:02 +0000 (22:56 -0400)] 
Merge pull request #1 from dltacube/config.py-typo

Update config.py

4 years agoUpdate config.py
Yoni Revah [Tue, 11 May 2021 02:52:57 +0000 (22:52 -0400)] 
Update config.py

typo

4 years agoUpdate README.unittests.rst
Gord Thompson [Sun, 9 May 2021 13:29:53 +0000 (07:29 -0600)] 
Update README.unittests.rst

Change-Id: I3262688c4ceb6de48959e36c92b1c55b7c0a3ba6

4 years agoVersion 1.6.3 placeholder
Mike Bayer [Fri, 7 May 2021 02:35:16 +0000 (22:35 -0400)] 
Version 1.6.3 placeholder

4 years ago- 1.6.2 rel_1_6_2
Mike Bayer [Fri, 7 May 2021 02:31:55 +0000 (22:31 -0400)] 
- 1.6.2

4 years agochangelog / docstring edits
Mike Bayer [Fri, 7 May 2021 02:31:07 +0000 (22:31 -0400)] 
changelog / docstring edits

Change-Id: I89be3f965d3556694f497a47a6b13247ce2a1d94

4 years agoMove empty downgrade revisions check to make it specific to branch filtering case...
Simon Bowly [Fri, 7 May 2021 01:21:55 +0000 (11:21 +1000)] 
Move empty downgrade revisions check to make it specific to branch filtering case as intended.

Fixed regression in new versioning traversal where "alembic downgrade head" (or equivalent) fails instead of iterating no revisions.

Fixes: #839
Change-Id: I9e8463ee067761ee4588c2ccc1b1009e2be97c38

4 years agoVersion 1.6.2 placeholder
Mike Bayer [Thu, 6 May 2021 17:11:12 +0000 (13:11 -0400)] 
Version 1.6.2 placeholder

4 years ago- 1.6.1 rel_1_6_1
Mike Bayer [Thu, 6 May 2021 17:09:31 +0000 (13:09 -0400)] 
- 1.6.1

4 years agonarrow rangenotancestor to exclude target heads already present
Mike Bayer [Thu, 6 May 2021 16:51:30 +0000 (12:51 -0400)] 
narrow rangenotancestor to exclude target heads already present

Fixed regression in new revisioning traversal where "alembic downgrade
base" would fail if the database itself were clean and unversioned;
additionally repairs the case where downgrade would fail if attempting
to downgrade to the current head that is already present.

Change-Id: I581cab5a17f69d82e41eab147ceb27a38fe4ce1d
Fixes: #838
4 years agoVersion 1.6.1 placeholder
Mike Bayer [Mon, 3 May 2021 18:48:08 +0000 (14:48 -0400)] 
Version 1.6.1 placeholder

4 years ago- 1.6.0 rel_1_6_0
Mike Bayer [Mon, 3 May 2021 18:45:39 +0000 (14:45 -0400)] 
- 1.6.0

4 years agochangelog updates
Mike Bayer [Mon, 3 May 2021 18:41:42 +0000 (14:41 -0400)] 
changelog updates

Change-Id: I46ad62f13771e267cf53f6ae10fd0d5748fa8ccb

4 years agonext release is 1.6, forgot to update changelog
Mike Bayer [Mon, 3 May 2021 18:25:28 +0000 (14:25 -0400)] 
next release is 1.6, forgot to update changelog

Change-Id: I063338daaaae96333995b2af5103a9e32740882c

4 years agoMerge "implement table comments for batch"
mike bayer [Tue, 27 Apr 2021 17:15:04 +0000 (17:15 +0000)] 
Merge "implement table comments for batch"

4 years agoimplement table comments for batch
Mike Bayer [Tue, 27 Apr 2021 16:08:28 +0000 (12:08 -0400)] 
implement table comments for batch

Added missing ``batch_op.create_table_comment()``,
``batch_op.drop_table_comment()`` directives to batch ops.

Change-Id: Ia7779619d150a2fe26abb8a8cc89d147a8432f8c
Fixes: #799
4 years agoSort per-column comparisons in metadata order
Mike Bayer [Tue, 27 Apr 2021 15:14:26 +0000 (11:14 -0400)] 
Sort per-column comparisons in metadata order

Improved the rendering of ``op.add_column()`` operations when adding
multiple columns to an existing table, so that the order of these
statements matches the order in which the columns were declared in the
application's table metadata. Previously the added columns were being
sorted alphabetically.

Change-Id: Ia2a603c934ab101d102d63e715e92f9be9b747a7
Fixes: #827
4 years agoNew downgrade algorithm to fix branch behaviour
Simon Bowly [Wed, 3 Feb 2021 03:11:15 +0000 (22:11 -0500)] 
New downgrade algorithm to fix branch behaviour

The algorithm used for calculating downgrades/upgrades/iterating
revisions has been rewritten, to resolve ongoing issues of branches
not being handled consistently particularly within downgrade operations,
as well as for overall clarity and maintainability.  This change includes
that a deprecation warning is emitted if an ambiguous command such
as "downgrade -1" when multiple heads are present is given.

In particular, the change implements a long-requested use case of allowing
downgrades of a single branch to a branchpoint.

Huge thanks to Simon Bowly for their impressive efforts in successfully
tackling this very difficult problem.

Topological algorithm written by Mike which retains the
behavior of walking along a single branch as long as
possible before switching to another branch due to
cross-dependencies.

Fixes: #765
Fixes: #464
Fixes: #603
Fixes: #660
Closes: #790
Pull-request: https://github.com/sqlalchemy/alembic/pull/790
Pull-request-sha: 60752399336b883d26f38d61a8337dd6fdd48087

Change-Id: I8ab81d241df52a6bf0a474ccee35b16aecd706ac

4 years agoMerge "Ensure proxy transaction still present on exit before closing"
mike bayer [Sat, 17 Apr 2021 17:23:18 +0000 (17:23 +0000)] 
Merge "Ensure proxy transaction still present on exit before closing"

4 years agonext release is 1.6.0
Mike Bayer [Sat, 17 Apr 2021 17:21:36 +0000 (13:21 -0400)] 
next release is 1.6.0

The change for #803 as well as the upcoming fix for
issue #765 are major changes to the internals, so we will be
on a new minor version.

Change-Id: I6c384c4900761d9b4fb27742a4c8ecb227aa87e3

4 years agoEnsure proxy transaction still present on exit before closing
Mike Bayer [Sat, 17 Apr 2021 16:53:22 +0000 (12:53 -0400)] 
Ensure proxy transaction still present on exit before closing

Fixed regression caused by the SQLAlchemy 1.4/2.0 compatibility switch
where calling ``.rollback()`` or ``.commit()`` explicitly within the
``context.begin_transaction()`` context manager would cause it to fail when
the block ended, as it did not expect that the transaction was manually
closed.

Change-Id: I4c5ba368bfd480d186276cd75edaac5019130bc6
Fixes: #829
4 years agoCreate schema objects fresh from ops
Mike Bayer [Fri, 26 Feb 2021 18:11:17 +0000 (13:11 -0500)] 
Create schema objects fresh from ops

Refactored the implementation of :class:`.MigrateOperation` constructs such
as :class:`.CreateIndexOp`, :class:`.CreateTableOp`, etc. so that they no
longer rely upon maintaining a persistent version of each schema object
internally; instead, the state variables of each operation object will be
used to produce the corresponding construct when the operation is invoked.
The rationale is so that environments which make use of
operation-manipulation schemes such as those those discussed in
:ref:`autogen_rewriter` are better supported, allowing end-user code to
manipulate the public attributes of these objects which will then be
expressed in the final output, an example is
``some_create_index_op.kw["postgresql_concurrently"] = True``.

Previously, these objects when generated from autogenerate would typically
hold onto the original, reflected element internally without honoring the
other state variables of each construct, preventing the public API from
working.

Change-Id: Ida2537740325de5c21e9447e930a518093f01bd4
Fixes: #803
4 years agoMerge pull request #825 from maresb/gitignore
Federico Caselli [Fri, 2 Apr 2021 18:36:11 +0000 (20:36 +0200)] 
Merge pull request #825 from maresb/gitignore

Add /pysqlite_test_schema.db to .gitignore

4 years agoAdd /pysqlite_test_schema.db to .gitignore 825/head
Ben Mares [Fri, 2 Apr 2021 18:13:11 +0000 (20:13 +0200)] 
Add /pysqlite_test_schema.db to .gitignore
Fixes #824

4 years agoAdd cwd post-write hook option
Ben Mares [Mon, 29 Mar 2021 20:44:36 +0000 (16:44 -0400)] 
Add cwd post-write hook option

Fixes #822

Implements a `.cwd` suboption for post-write hooks.

For example, one can do
```ini
[post_write_hooks]
hooks = pre-commit

pre-commit.type = console_scripts
pre-commit.entrypoint = pre-commit
pre-commit.options = run --files REVISION_SCRIPT_FILENAME
pre-commit.cwd = %(here)s
```

This feature is illustrated by the last line above.

### Description

* Improve the names of some variables recently created in #820 in order to make the code more readable.
* Add `cwd` as an option which is passed directly into `subprocess.run()`
* Add a brief description to the documentation, together with an example with `pre-commit`.
<!-- 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 new feature implementation

- [X] please include the issue number, and create an issue if none exists, which must
- [X] include a complete example of how the feature would look.
- [X] Please include: `Fixes: #<issue number>` in the commit message
- [x] **please include tests.**

**Help requested:** I can't think of any simple way to write a test. Does anyone have a suggestion???

Closes: #823
Pull-request: https://github.com/sqlalchemy/alembic/pull/823
Pull-request-sha: 9a694a7fdfc55160d1e124f6119a7a5677ce019a

Change-Id: Iacbb06d52acc362588cff2cdfec442393be8594a

4 years agoAdd REVISION_SCRIPT_FILENAME token for post_write_hooks options
Ben Mares [Sat, 27 Mar 2021 08:44:49 +0000 (04:44 -0400)] 
Add REVISION_SCRIPT_FILENAME token for post_write_hooks options

I include a token called `REVISION_SCRIPT_FILENAME` which can be used in the `options` setting of a post-write hook. This token is replaced by the filename of the revision script, allowing the filename to be passed to the post-write hook in a flexible manner. Thus I can do:

```ini
[post_write_hooks]
hooks = pre-commit
pre-commit.type = console_scripts
pre-commit.entrypoint = pre-commit
pre-commit.options = run --files REVISION_SCRIPT_FILENAME
```

Note that the existing behavior is to prepend `REVISION_SCRIPT_FILENAME` to the argument list. In order to preserve backwards compatibility, this is done when `REVISION_SCRIPT_FILENAME` is not present.

### Description
* Implement the `REVISION_SCRIPT_FILENAME` token.
* Switch from `str.split()` to `shlex.split()` for robust command line argument processing.
* Insert `REVISION_SCRIPT_FILENAME` in appropriate locations in the docs and templates.
* Properly document that `REVISION_SCRIPT_FILENAME` is prepended instead of appended to the argument list.
* Refactored existing "test of `black` as a post-write hook" in order to avoid code duplication.
* Add a test for `REVISION_SCRIPT_FILENAME` and shlex.

### 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 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 issue #819

Closes: #820
Pull-request: https://github.com/sqlalchemy/alembic/pull/820
Pull-request-sha: 73dd0a4d60758a06551a0aff47b9723b0345d74a

Change-Id: Ibfc677d59086703872d7cfd5c2da32bd0220a25f

4 years agoVersion 1.5.9 placeholder
Mike Bayer [Tue, 23 Mar 2021 18:24:45 +0000 (14:24 -0400)] 
Version 1.5.9 placeholder

4 years ago- 1.5.8 rel_1_5_8
Mike Bayer [Tue, 23 Mar 2021 18:13:02 +0000 (14:13 -0400)] 
- 1.5.8

4 years agouse new URL api for password obfuscate
Mike Bayer [Tue, 23 Mar 2021 13:40:27 +0000 (09:40 -0400)] 
use new URL api for password obfuscate

Fixed regression caused by SQLAlchemy 1.4 where the "alembic current"
command would fail due to changes in the ``URL`` object.

Change-Id: Ic0023885188c75ace19035adcf4c11c7bd10a843
Fixes: #816
4 years agoVersion 1.5.8 placeholder
Mike Bayer [Thu, 11 Mar 2021 16:25:00 +0000 (11:25 -0500)] 
Version 1.5.8 placeholder

4 years ago- 1.5.7 rel_1_5_7
Mike Bayer [Thu, 11 Mar 2021 16:22:26 +0000 (11:22 -0500)] 
- 1.5.7

4 years agoenable extensions to use AutogenContext.run_name_filters
Oliver Rice [Fri, 5 Mar 2021 19:23:40 +0000 (14:23 -0500)] 
enable extensions to use AutogenContext.run_name_filters

Adjusted the recently added
:paramref:`.EnvironmentContext.configure.include_name` hook to accommodate
for additional object types such as "views" that don't have a parent table,
to support third party recipes and extensions. Pull request courtesy Oliver
Rice.

Fixes: #813
Closes: #814
Pull-request: https://github.com/sqlalchemy/alembic/pull/814
Pull-request-sha: 45dbc9c3baebd02c44cdcafc7ac73f00e87d8a86

Change-Id: I75f22b745bd847638b9fdff9c19c1f0091a6b470

4 years agoVersion 1.5.7 placeholder
Mike Bayer [Fri, 5 Mar 2021 15:07:59 +0000 (10:07 -0500)] 
Version 1.5.7 placeholder

4 years ago- 1.5.6 rel_1_5_6
Mike Bayer [Fri, 5 Mar 2021 14:59:54 +0000 (09:59 -0500)] 
- 1.5.6

4 years agoAdjust mssql accommodate existing_type and type
Mike Bayer [Thu, 4 Mar 2021 15:54:03 +0000 (10:54 -0500)] 
Adjust mssql accommodate existing_type and type

Fixed bug where the "existing_type" parameter, which the MSSQL dialect
requires in order to change the nullability of a column in the absence of
also changing the column type, would cause an ALTER COLUMN operation to
incorrectly render a second ALTER statement without the nullability if a
new type were also present, as the MSSQL-specific contract did not
anticipate all three of "nullability", "type_" and "existing_type" being
sent at the same time.

Change-Id: Ia95b6c3e9276cc067fd773928f9678ab429d5670
Fixes: #812
4 years agoremove unnecessary whitespace changes made by GitHub 809/head
James Lamb [Mon, 1 Mar 2021 23:56:02 +0000 (17:56 -0600)] 
remove unnecessary whitespace changes made by GitHub

4 years ago[doc] clarify ALTER language in batch docs
James Lamb [Mon, 1 Mar 2021 23:02:09 +0000 (17:02 -0600)] 
[doc] clarify ALTER language in batch docs

4 years agoAdd async template to Alembic
CaselIT [Fri, 26 Feb 2021 20:21:52 +0000 (21:21 +0100)] 
Add async template to Alembic

Add async template to Alembic to bootstrap environments that use
async DBAPI. Updated the cookbook to include a migration guide
on how to adapt an existing enviroment for use with DBAPI drivers.

Fixes: #805
Change-Id: I5281b95ce8d48a31591902116c746ef9ae3fd7af

4 years ago[docs] fix versionchanged directive in autogenerate docs 798/head
James Lamb [Mon, 22 Feb 2021 05:35:52 +0000 (23:35 -0600)] 
[docs] fix versionchanged directive in autogenerate docs

4 years agoVersion 1.5.6 placeholder
Mike Bayer [Sat, 20 Feb 2021 21:48:55 +0000 (16:48 -0500)] 
Version 1.5.6 placeholder

4 years ago- 1.5.5 rel_1_5_5
Mike Bayer [Sat, 20 Feb 2021 21:47:00 +0000 (16:47 -0500)] 
- 1.5.5

4 years agoMerge "Implement sys_path_prepend option"
mike bayer [Sat, 20 Feb 2021 21:46:06 +0000 (21:46 +0000)] 
Merge "Implement sys_path_prepend option"

4 years agoImplement sys_path_prepend option
Mike Bayer [Sat, 20 Feb 2021 20:48:58 +0000 (15:48 -0500)] 
Implement sys_path_prepend option

Added new config file option ``prepend_sys_path``, which is a series of
paths that will be prepended to sys.path; the default value in newly
generated alembic.ini files is ".".  This fixes a long-standing issue
where for some reason running the alembic command line would not place the
local "." path in sys.path, meaning an application locally present in "."
and importable through normal channels, e.g. python interpreter, pytest,
etc. would not be located by Alembic, even though the ``env.py`` file is
loaded relative to the current path when ``alembic.ini`` contains a
relative path.

Change-Id: If8f4279bd862acca44d46f4b1ab90b0a18098af3
Fixes: #797