]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
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
4 years agoadd versions for pre-commit tools
Mike Bayer [Sat, 20 Feb 2021 20:53:44 +0000 (15:53 -0500)] 
add versions for pre-commit tools

latest pre-commit is warning for use of "master" so apply version
numbers

Change-Id: I1375ef87a6d0b67e0fb0caeb03743d0dcd1af5ea

4 years agoUse SQLAlchemy _copy() when available
Mike Bayer [Thu, 18 Feb 2021 20:31:42 +0000 (15:31 -0500)] 
Use SQLAlchemy _copy() when available

Adjusted the use of SQLAlchemy's ".copy()" internals to use "._copy()"
for version 1.4.0, as this method is being renamed.

Change-Id: I1e69a1628e408f06b43efbc0cc52fc0ad1e8cbc4

4 years agoMerge remote-tracking branch 'github/pr/731'
Mike Bayer [Mon, 8 Feb 2021 16:14:45 +0000 (11:14 -0500)] 
Merge remote-tracking branch 'github/pr/731'

Change-Id: I66800d081f8da1160410357408d3e7ffa96f0aa3

4 years agoUpdate cookbook.rst references to #753 791/head
Andrew Fitzgerald [Sat, 6 Feb 2021 02:45:20 +0000 (21:45 -0500)] 
Update cookbook.rst references to #753

A fix for #753 was merged in November 2020 and released in 1.5.0 in January 2021.
This updates the references to #753 in cookbook.rst to note that a fix for #753 has been released.

4 years agoVersion 1.5.5 placeholder
Mike Bayer [Wed, 3 Feb 2021 15:03:47 +0000 (10:03 -0500)] 
Version 1.5.5 placeholder

4 years ago- 1.5.4 rel_1_5_4
Mike Bayer [Wed, 3 Feb 2021 15:01:34 +0000 (10:01 -0500)] 
- 1.5.4

4 years agoAdjust for immediate dependencies that are still ancestors
Mike Bayer [Tue, 2 Feb 2021 05:18:48 +0000 (00:18 -0500)] 
Adjust for immediate dependencies that are still ancestors

Fixed bug in versioning model where a downgrade across a revision with a
dependency on another branch, yet an ancestor is also dependent on that
branch, would produce an erroneous state in the alembic_version table,
making upgrades impossible without manually repairing the table.

Change-Id: Ic755f8c3f78845bb80f4f5b3d172caf77cb51132
Fixes: #789
4 years agoVersion 1.5.4 placeholder
Mike Bayer [Fri, 29 Jan 2021 21:54:36 +0000 (16:54 -0500)] 
Version 1.5.4 placeholder

4 years ago- 1.5.3 rel_1_5_3
Mike Bayer [Fri, 29 Jan 2021 21:51:30 +0000 (16:51 -0500)] 
- 1.5.3

4 years agoRemove obsolete SQLAlchemy pk issue workaround
Mike Bayer [Fri, 29 Jan 2021 01:10:33 +0000 (20:10 -0500)] 
Remove obsolete SQLAlchemy pk issue workaround

Fixed issue where autogenerate rendering of ``op.alter_column()`` would
fail to include MySQL ``existing_nullable=False`` if the column were part
of a primary key constraint within the table metadata.

Change-Id: I6f3473b66c0faee035a438a25dcbe3a6f24eb041
Fixes: #788
4 years agoEnable SQL Server testing and fix autogen issues
Mike Bayer [Wed, 27 Jan 2021 19:01:40 +0000 (14:01 -0500)] 
Enable SQL Server testing and fix autogen issues

Fixed assorted autogenerate issues with SQL Server:

* ignore default reflected identity on primary_key columns
* improve server default comparison

Updated test_autogen_fks for modern levels of FK
capabilities

Change-Id: I94b815cedf90422ccd5ceceb765b07d772b505b7
Fixes: #787
4 years agoPlace index/uq drops before creates
Mike Bayer [Wed, 27 Jan 2021 17:28:37 +0000 (12:28 -0500)] 
Place index/uq drops before creates

Changed the default ordering of "CREATE" and "DROP" statements indexes and
unique constraints within the autogenerate process, so that for example in
an upgrade() operation, a particular index or constraint that is to be
replaced such as for a casing convention change will not produce any naming
conflicts. For foreign key constraint objects, this is already how
constraints are ordered, and for table objects, users would normally want
to use :meth:`.Operations.rename_table` in any case.

Change-Id: I1b20e8ce6e1ea080df5c1738bf2e7ae91c0c40ad
Fixes: #786
4 years agotemporarily block mssql
Mike Bayer [Wed, 27 Jan 2021 20:48:16 +0000 (15:48 -0500)] 
temporarily block mssql

We've enabled mssql on jenkins which is failing
right now.  Disable it from tox directly so builds
can run until we get it fixed.

Also see if we can switch to using SQLAlchemy
extras_require here.

Change-Id: If644ecccb08e72da525ab40370141d2d20de093b

4 years agoVersion 1.5.3 placeholder
Mike Bayer [Wed, 20 Jan 2021 18:34:19 +0000 (13:34 -0500)] 
Version 1.5.3 placeholder

4 years ago- 1.5.2 rel_1_5_2
Mike Bayer [Wed, 20 Jan 2021 18:30:40 +0000 (13:30 -0500)] 
- 1.5.2

4 years agoensure downrev/dependencies in tuple form before using "in"
Mike Bayer [Wed, 20 Jan 2021 16:40:52 +0000 (11:40 -0500)] 
ensure downrev/dependencies in tuple form before using "in"

Fixed regression where new "loop detection" feature introduced in
:ticket:`757` produced false positives for revision names that have
overlapping substrings between revision number and down revision and/or
dependency, if the downrev/dependency were not in sequence form.

Fixes: #784
Change-Id: I9f31298c91ee2d3c1c63fd1f52bf8e0309b6ad88

4 years agoFix workflow test window fail
CaselIT [Tue, 19 Jan 2021 20:43:32 +0000 (15:43 -0500)] 
Fix workflow test window fail

Need to disable asyncio before calling into pytest session start or windows will fails randomly.

Closes: #783
Pull-request: https://github.com/sqlalchemy/alembic/pull/783
Pull-request-sha: c92f7a2c0460899c942fcc668cbffe672b59df01

Change-Id: I9026334db651aa977fbc809494f449e38ca16a6f

4 years agoretrieve 1.3 transaction from branched connection properly
Mike Bayer [Tue, 19 Jan 2021 19:26:46 +0000 (14:26 -0500)] 
retrieve 1.3 transaction from branched connection properly

Fixed regression where Alembic would fail to create a transaction properly
if the :class:`sqlalchemy.engine.Connection` were a so-called "branched"
connection, that is, one where the ``.connect()`` method had been called to
create a "sub" connection.

Change-Id: I5319838a08686ede7dc873ce5d39428b1afdf6ff
Fixes: #782
4 years agoVersion 1.5.2 placeholder
Mike Bayer [Tue, 19 Jan 2021 15:21:52 +0000 (10:21 -0500)] 
Version 1.5.2 placeholder

4 years ago- 1.5.1 rel_1_5_1
Mike Bayer [Tue, 19 Jan 2021 15:19:02 +0000 (10:19 -0500)] 
- 1.5.1

4 years agofix typo
Mike Bayer [Tue, 19 Jan 2021 15:18:26 +0000 (10:18 -0500)] 
fix typo

Change-Id: Ieb504598707487c11ba51458a4e505b749ad711e

4 years agofix erroneous package_dir directive
Mike Bayer [Tue, 19 Jan 2021 14:55:06 +0000 (09:55 -0500)] 
fix erroneous package_dir directive

Fixed installation issue where the "templates" directory was not being
installed, preventing commands like "list-templates" and "init" from
working.

Change-Id: Ic47cee2dbb3c4c81a34e91557a3275ef68a22b74
Fixes: #780
4 years agoVersion 1.5.1 placeholder
Mike Bayer [Mon, 18 Jan 2021 20:59:38 +0000 (15:59 -0500)] 
Version 1.5.1 placeholder

4 years ago- 1.5.0 rel_1_5_0
Mike Bayer [Mon, 18 Jan 2021 20:52:24 +0000 (15:52 -0500)] 
- 1.5.0

4 years agoremove all .. version(?:changed|added):: prior to 1.0
Mike Bayer [Mon, 18 Jan 2021 20:27:01 +0000 (15:27 -0500)] 
remove all .. version(?:changed|added):: prior to 1.0

Change-Id: I2a1a0c273adc871b12e13d7f913609fe1122dab3

4 years agoimplement include_name hook
Mike Bayer [Mon, 18 Jan 2021 17:27:38 +0000 (12:27 -0500)] 
implement include_name hook

Added new hook :paramref:`.EnvironmentContext.configure.include_name`,
which complements the
:paramref:`.EnvironmentContext.configure.include_object` hook by providing
a means of preventing objects of a certain name from being autogenerated
**before** the SQLAlchemy reflection process takes place, and notably
includes explicit support for passing each schema name when
:paramref:`.EnvironmentContext.configure.include_schemas` is set to True.
This is most important especially for enviroments that make use of
:paramref:`.EnvironmentContext.configure.include_schemas` where schemas are
actually databases (e.g. MySQL) in order to prevent reflection sweeps of
the entire server.

The long deprecated
:paramref:`.EnvironmentContext.configure.include_symbol` hook is removed.
The  :paramref:`.EnvironmentContext.configure.include_object`
and  :paramref:`.EnvironmentContext.configure.include_name`
hooks both achieve the goals of this hook.

Change-Id: Idd44a357088a79be94488fdd7a7841bf118d47e2
Fixes: #650
4 years agoRemove remaining 2.0 warning
Mike Bayer [Fri, 15 Jan 2021 18:44:53 +0000 (13:44 -0500)] 
Remove remaining 2.0 warning

with the merge of If6b792e57c8c5dff205419644ab68e631575a2fa
in SQLAlchemy we can remove this last 2.0 deprecation warning
filter.

Change-Id: I2a615dc70432e9b6a89a551f405c2a81bcbb8981

4 years agoMerge "Support default nullable on identity columns."
mike bayer [Fri, 15 Jan 2021 16:46:05 +0000 (16:46 +0000)] 
Merge "Support default nullable on identity columns."

4 years agoSupport default nullable on identity columns.
CaselIT [Sat, 9 Jan 2021 10:57:46 +0000 (11:57 +0100)] 
Support default nullable on identity columns.

This fixes the test for I0516d506ff327cff35cda605e8897a27440e0373

Change-Id: Ief4546fcb7d4d266d0f1f73ed53069dc5cb34fde

4 years agodocumentation fixes
Mike Bayer [Fri, 15 Jan 2021 15:23:36 +0000 (10:23 -0500)] 
documentation fixes

Change-Id: I1f2e8376ce86886a9b35fa48cb7a78ca1735095c

4 years agodisable SQLA 1.4 asyncio mode
Mike Bayer [Tue, 12 Jan 2021 21:33:31 +0000 (16:33 -0500)] 
disable SQLA 1.4 asyncio mode

The latest merge that uses SQLAlchemy's test suite
more fully is not functioning with the asyncio wrappers.
As we don't need those here right now, disable them.

Change-Id: Iafccb38386ab548614d6dd7a500356a635396289

4 years agoMerge "Accommodate SQLAlchemy 1.4/2.0"
mike bayer [Tue, 12 Jan 2021 15:50:33 +0000 (15:50 +0000)] 
Merge "Accommodate SQLAlchemy 1.4/2.0"

4 years agoAccommodate SQLAlchemy 1.4/2.0
CaselIT [Mon, 19 Oct 2020 21:23:08 +0000 (23:23 +0200)] 
Accommodate SQLAlchemy 1.4/2.0

To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer
assumes that the SQLAlchemy Connection will autocommit an individual
operation.   This essentially means that for databases that use
non-transactional DDL (pysqlite current driver behavior, MySQL), there is
still a BEGIN/COMMIT block that will surround each individual migration.
Databases that support transactional DDL should continue to have the
same flow, either per migration or per-entire run, depending on the
value of the :paramref:`.Environment.configure.transaction_per_migration`
flag.

Compatibility is established such that the entire library should
not generate any SQLAlchemy 2.0 deprecation warnings and
SQLALCHEMY_WARN_20 is part of conftest.py. (one warning remains
for the moment that needs to be resolved on the SQLAlchemy side)

The test suite requires SQLAlchemy 1.4.0b2 for testing 1.4;
1.4.0b1 won't work.

Test suite / setup also being modernized, as we are at
SQLAlchemy 1.3 we can now remove the majority of the testing
suite plugin.

Change-Id: If55b1ea3c12ead66405ab3fadc76d15d89dabb90

4 years agoPin PyMySQL < 1.0.0 for python 2
Mike Bayer [Thu, 7 Jan 2021 19:09:09 +0000 (14:09 -0500)] 
Pin PyMySQL < 1.0.0 for python 2

Change-Id: I4b5533463acb858c76739e56d94c0e642035cee4

4 years agohappy new year
Mike Bayer [Mon, 4 Jan 2021 14:42:23 +0000 (09:42 -0500)] 
happy new year

Change-Id: Ib2dc683401cd48d00b357bb735ce4b7a540d0ed2

4 years agoConsult ApplyBatchImpl for hints on constraints to drop
Mike Bayer [Sun, 27 Dec 2020 21:40:48 +0000 (16:40 -0500)] 
Consult ApplyBatchImpl for hints on constraints to drop

Made an adjustment to the PostgreSQL dialect to allow it to work more
effectively in batch mode, where a datatype like Boolean or non-native Enum
that may have embedded rules to generate CHECK constraints will be more
correctly handled in that these constraints usually will not have been
generated on the PostgreSQL backend; previously it would inadvertently
assume they existed unconditionally in a special PG-only "drop constraint"
step.

Change-Id: I024b07bee6eec92061d902cbe1b086cb5b3ecd7c
Fixes: #773
4 years agouse private alembic name for fixture metadata
Mike Bayer [Mon, 21 Dec 2020 20:04:32 +0000 (15:04 -0500)] 
use private alembic name for fixture metadata

assigning self.metadata conflicts with fixtures in
SQLAlchemy inlcuding a class level method we hope to add.

Change-Id: Ifebb654268f5e4a13643adf79acb2e7c3df08b05

4 years agoMerge "Add support identity columns."
mike bayer [Thu, 17 Dec 2020 19:33:58 +0000 (19:33 +0000)] 
Merge "Add support identity columns."

4 years agoUse exclusions from sqlalchemy
CaselIT [Tue, 15 Dec 2020 22:17:20 +0000 (23:17 +0100)] 
Use exclusions from sqlalchemy

Since alembic 1.5 will support only sqlalchemy 1.3+ it can
safely use the exclusions from sqlalchemy.

Enable test for computed columns with sqlite >= 3.31

Fixes: #759
Change-Id: If629e0c0aa264205fa571e26b3ba8398634c374d

4 years agoAdd support identity columns.
CaselIT [Tue, 17 Nov 2020 21:32:36 +0000 (22:32 +0100)] 
Add support identity columns.

Added support for rendering of "identity" elements on
:class:`.Column` objects, supported in SQLAlchemy via
the :class:`.Identity` element introduced in version 1.4.

Adding columns with identity is supported on PostgreSQL,
MSSQL and Oracle. Changing the identity options or removing
it is supported only on PostgreSQL and Oracle.

Fixes: #730
Change-Id: I184d8bd30ef5c6286f3263b4033ca4eb359c02e2

4 years agoRaise an exception if any loop or cycle found in a revision graph constructed.
Koichiro Den [Tue, 1 Dec 2020 02:53:33 +0000 (21:53 -0500)] 
Raise an exception if any loop or cycle found in a revision graph constructed.

The revision tree is now checked for cycles and loops between revision
files when the revision environment is loaded up.  Scenarios such as a
revision pointing to itself, or a revision that can reach itself via a
loop, are handled and will raise the :class:`.CycleDetected` exception when
the environment is loaded (expressed from the Alembic commandline as a
failure message and nonzero return code). Previously, these situations were
silently ignored up front, and the behavior of revision traversal would
either be silently incorrect, or would produce errors such as
:class:`.RangeNotAncestorError`.  Pull request courtesy Koichiro Den.

Fixes: #757
Closes: #758
Pull-request: https://github.com/sqlalchemy/alembic/pull/758
Pull-request-sha: a5c5a72c407b74e8b2ca9a1289a85617e154fcb9

Change-Id: I2199caf237870df943e5a8816e6f0beb80a5950a

4 years agoMerge "Add more missing mariadb directives"
mike bayer [Sat, 28 Nov 2020 03:04:14 +0000 (03:04 +0000)] 
Merge "Add more missing mariadb directives"

4 years agoAdd more missing mariadb directives
Mike Bayer [Fri, 27 Nov 2020 17:52:05 +0000 (12:52 -0500)] 
Add more missing mariadb directives

Continuing from 985422d42f0670c4019cd3d208aa
I6e17f65842bda0aaf6e67437d12078318311eb60 , more mariadb idenifiers
needed.

Change-Id: Ie1d4067064d445253ab1c6ae9e066eef33e13c4c

4 years agoImplement column comments for batch
Mike Bayer [Fri, 27 Nov 2020 17:48:53 +0000 (12:48 -0500)] 
Implement column comments for batch

Added missing "create comment" feature for columns that are altered in
batch migrations.

Change-Id: I7468937702cefc8f581e27b1c4ba670e4f8b7d17
Fixes: #761
4 years agoMerge "Copy column that's already attached"
mike bayer [Thu, 5 Nov 2020 14:44:19 +0000 (14:44 +0000)] 
Merge "Copy column that's already attached"

4 years agoMerge "Added detection of Table prefixes in the create table render"
mike bayer [Thu, 5 Nov 2020 14:39:16 +0000 (14:39 +0000)] 
Merge "Added detection of Table prefixes in the create table render"

4 years agoAdd cookbook recipe illustrating autogenerate->invoke directly
Mike Bayer [Thu, 5 Nov 2020 14:05:42 +0000 (09:05 -0500)] 
Add cookbook recipe illustrating autogenerate->invoke directly

Change-Id: I46c0436971f50c0969f70ecf99c191533db65dcf

4 years agoAdded detection of Table prefixes in the create table render
rmoretto [Sat, 5 Sep 2020 16:30:45 +0000 (12:30 -0400)] 
Added detection of Table prefixes in the create table render

Added rendering for the ``Table.prefixes`` element to autogenerate so that
the rendered Python code includes these directives. Pull request courtesy
Rodrigo Ce Moretto.

Fixes: #721
Closes: #734
Pull-request: https://github.com/sqlalchemy/alembic/pull/734
Pull-request-sha: 4917e195c184b79d63ea60a31ae8ea59e499162c

Change-Id: I1e53500d49784c3ce2672fa9ce82876fa7645ee9

4 years agoCopy column that's already attached
Mike Bayer [Thu, 5 Nov 2020 13:22:18 +0000 (08:22 -0500)] 
Copy column that's already attached

Modified the ``add_column()`` operation such that the ``Column`` object in
use is shallow copied to a new instance if that ``Column`` is already
attached to a ``table()`` or ``Table``. This accommodates for the change
made in SQLAlchemy issue #5618 which prohibits a ``Column`` from being
associated with multiple ``table()`` objects. This resumes support for
using a ``Column`` inside of an Alembic operation that already refers to a
parent ``table()`` or ``Table`` as well as allows operation objects just
autogenerated to work.

Change-Id: Idc6933cf0da40373f4f270d75883995822c072f0
Fixes: #753
4 years agoAdd ``__main__.py`` file to alembic package
CaselIT [Sun, 18 Oct 2020 17:42:33 +0000 (19:42 +0200)] 
Add ``__main__.py`` file to alembic package

Also reformat the changelog a bit

Fixes: #728
Change-Id: I9198bd9f9fc5d8723a8ddca9faad8835b514fcc0

4 years agoRemoved of old deprecated code:
CaselIT [Tue, 27 Oct 2020 20:55:48 +0000 (21:55 +0100)] 
Removed of old deprecated code:

  * ``--head_only`` option to the ``alembic current`` command
  * legacy argument names in operations, deprecated since version 0.8

Change-Id: Ib6e265e3c2820971d446a1568de16e4a6efb18eb

4 years agoMerge "Update black to 20.8b1"
mike bayer [Tue, 27 Oct 2020 13:08:49 +0000 (13:08 +0000)] 
Merge "Update black to 20.8b1"

4 years agoAdd github test workflows
CaselIT [Mon, 26 Oct 2020 19:51:07 +0000 (20:51 +0100)] 
Add github test workflows

Change-Id: Ic76936a6fa3617410ad6419a106fdbb0f320a77a

4 years agoUpdate black to 20.8b1
CaselIT [Mon, 26 Oct 2020 19:39:37 +0000 (20:39 +0100)] 
Update black to 20.8b1

Change-Id: Id9b8ce6a0ccd2a6fa17b779c95d4079a5fa629d7

4 years agoRemove support for Python 3.5 and SQLAlchemy older than the 1.3 series.
CaselIT [Fri, 16 Oct 2020 19:39:41 +0000 (21:39 +0200)] 
Remove support for Python 3.5 and SQLAlchemy older than the 1.3 series.

Fixes: #748
Change-Id: I18df97bdce5de6adb222d3f16486272e95b1b1a6