]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
2 years agoVersion 1.9.2 placeholder
Mike Bayer [Fri, 23 Dec 2022 19:28:29 +0000 (14:28 -0500)] 
Version 1.9.2 placeholder

2 years ago- 1.9.1 rel_1_9_1
Mike Bayer [Fri, 23 Dec 2022 19:26:23 +0000 (14:26 -0500)] 
- 1.9.1

2 years agoMerge "dont use repr to quote string in compare_server_default" into main
mike bayer [Fri, 23 Dec 2022 19:25:13 +0000 (19:25 +0000)] 
Merge "dont use repr to quote string in compare_server_default" into main

2 years agodont use repr to quote string in compare_server_default
Mike Bayer [Thu, 22 Dec 2022 23:41:20 +0000 (18:41 -0500)] 
dont use repr to quote string in compare_server_default

Fixed issue where server default compare would not work for string defaults
that contained backslashes, due to mis-rendering of these values when
comparing their contents.

The server default comparison still has a lot of not-robust behaviors,
however at least get in place a parameterized test suite so that we
can add new scenarios quickly.

Made a slight adjustment to SQLite's compare server default implementation
to better handle defaults with or without parens around them, from both
the reflected and the local metadata side.

Implemented basic server default comparison for the Oracle backend;
previously, Oracle's formatting of reflected defaults prevented any
matches from occurring.

Change-Id: If5a69eec4b22d243a564d2c89e78ae33ba5be88f
Fixes: #1145
2 years agoVersion 1.9.1 placeholder
Mike Bayer [Thu, 15 Dec 2022 18:09:38 +0000 (13:09 -0500)] 
Version 1.9.1 placeholder

2 years ago- 1.9.0 rel_1_9_0
Mike Bayer [Thu, 15 Dec 2022 18:04:05 +0000 (13:04 -0500)] 
- 1.9.0

2 years agoadd check command for upgrade diffs
Nathan Louie [Tue, 13 Dec 2022 17:58:09 +0000 (12:58 -0500)] 
add check command for upgrade diffs

Added new Alembic command ``alembic check``. This performs the widely
requested feature of running an "autogenerate" comparison between the
current database and the :class:`.MetaData` that's currently set up for
autogenerate, returning an error code if the two do not match, based on
current autogenerate settings. Pull request courtesy Nathan Louie.

As this is a new feature we will call this 1.9.0

Fixes: #724
Closes: #1101
Pull-request: https://github.com/sqlalchemy/alembic/pull/1101
Pull-request-sha: 807ed545df70e7a10b913e2951a1b636f138a4ff

Change-Id: I03b146eaf762be464a0ff0858ff5730cc9366c84

2 years agotry to restore color to pytest
Mike Bayer [Sun, 11 Dec 2022 20:25:34 +0000 (15:25 -0500)] 
try to restore color to pytest

the problem here is that the color codes will come out in
jenkins runs.  see if jenkins maybe does something with that
(filters or maybe even gives us color)

Change-Id: I9c8660fa85fb216cae16e18b776f34b005d3ac51

2 years agoadjust for tox changes to passenv
Mike Bayer [Sun, 11 Dec 2022 16:31:10 +0000 (11:31 -0500)] 
adjust for tox changes to passenv

Fixed issue in tox.ini file where changes in the tox 4.0 series to the
format of "passenv" caused tox to not function correctly, in particular
raising an error as of tox 4.0.6.

Change-Id: I659c8fc523a71deaa02a89103c9e7241cf81d831
References: https://github.com/tox-dev/tox/issues/2676

2 years agoadd width + overflow to keep toc from flowing out of sidebar
Mike Bayer [Mon, 28 Nov 2022 20:54:11 +0000 (15:54 -0500)] 
add width + overflow to keep toc from flowing out of sidebar

also add sphinx-autobuild to the makefile

Change-Id: I7abd08cefe98d6b57394fad20bd06c3e0b928465
References: https://github.com/sphinx-doc/sphinx/issues/11000
(cherry picked from commit 9eafd483018775d9e1144512ed820ba2a80d2e61)

2 years agorun pyupgrade
Mike Bayer [Fri, 25 Nov 2022 17:29:40 +0000 (12:29 -0500)] 
run pyupgrade

command is:

find alembic -name "*.py" | xargs pyupgrade --py37-plus --keep-runtime-typing --keep-percent-format

I'm having some weird fighting with the tools/write_pyi, where
in different runtime contexts it keeps losing "MigrationContext"
and also Callable drops the args, but it's not consisistent.
For whatever reason, under py311 things *do* work every time.
im working w/ clean tox environments so not really sure what the
change is.  anyway, let's at least fix the quoting up
around the types.

This is towards getting the "*" in the op signatures for #1130.

Change-Id: I9175905d3b4325e03a97d6752356b70be20e9fad

2 years agoMerge "add typing parameters" into main
mike bayer [Wed, 16 Nov 2022 00:01:14 +0000 (00:01 +0000)] 
Merge "add typing parameters" into main

2 years agoadd typing parameters
Mike Bayer [Mon, 7 Nov 2022 18:05:08 +0000 (13:05 -0500)] 
add typing parameters

Fixed typing issue where :paramref:`.revision.process_revision_directives`
was not fully typed; additionally ensured all ``Callable`` and ``Dict``
arguments to :meth:`.EnvironmentContext.configure` include parameters in
the typing declaration.

Change-Id: I3ac389992f357359439be5659af33525fc290f96
Fixes: #1110
2 years agoUpdated cookbook docs (#1111)
Amel Alispahic [Mon, 7 Nov 2022 19:47:20 +0000 (20:47 +0100)] 
Updated cookbook docs (#1111)

2 years agofix search path indicator
Mike Bayer [Mon, 17 Oct 2022 12:52:55 +0000 (08:52 -0400)] 
fix search path indicator

Change-Id: I341a57f0bbf7c237c86cb8de4c94a37d737c3c85
Fixes: #1096
2 years agouse SQLAlchemy built-in password obfuscation
Mike Bayer [Fri, 23 Sep 2022 14:44:17 +0000 (10:44 -0400)] 
use SQLAlchemy built-in password obfuscation

As str(url) will be changing to obfuscate the PW,
use SQLA 1.3 / 1.4 / 2.0 functionality directly.

Change-Id: I4694cc6d2ed7f0463fe0fae8a93ee9ec5df74760
References: https://github.com/sqlalchemy/sqlalchemy/issues/8567

2 years agoImprove typing
CaselIT [Sun, 11 Sep 2022 20:38:46 +0000 (22:38 +0200)] 
Improve typing

Change-Id: I9fc86c4a92e1b76d19c9e891ff08ce8a46ad4e35

2 years agoAdd missing types to **kw
eykamp [Thu, 8 Sep 2022 20:50:30 +0000 (16:50 -0400)] 
Add missing types to **kw

Simple change to fix (some) type checking with Pyright and friends.

Add missing types to **kw

Simple update to types, consistent with other similar instances already in place.

<!-- 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:  somewhere between the first and second options.  I don't think it merits an issue or test coverage.

- [ ] 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: #1073
Pull-request: https://github.com/sqlalchemy/alembic/pull/1073
Pull-request-sha: 34f0e38e7193a65b659e8af7fff553427048f536

Change-Id: I5f84478e59a74d3d841ff32a0c536e5b32cc9b21

2 years agoFix typo in docs/build/api/runtime.rst (#1084)
Johnny Deuss [Thu, 8 Sep 2022 20:46:12 +0000 (21:46 +0100)] 
Fix typo in docs/build/api/runtime.rst (#1084)

3 years agoadd docs for naming convention bypass case
Mike Bayer [Tue, 19 Jul 2022 16:01:50 +0000 (12:01 -0400)] 
add docs for naming convention bypass case

Change-Id: I8d604eaab7865466b8a7008693621c00f954397d
References: #453

3 years agoMerge "Ignore reflected expression based indexes" into main
Federico Caselli [Thu, 14 Jul 2022 17:19:43 +0000 (17:19 +0000)] 
Merge "Ignore reflected expression based indexes" into main

3 years agoIgnore reflected expression based indexes
CaselIT [Mon, 4 Jul 2022 20:47:20 +0000 (22:47 +0200)] 
Ignore reflected expression based indexes

this establishes forwads-compatibility for
PostgreSQL expression-based index reflection
being added in I3e36d557235286c0f7f6d8276272ff9225058d48

Change-Id: I81d7832f254f50dc3417dd3437c2b49ec3a549e2

3 years agoVersion 1.8.2 placeholder
Mike Bayer [Wed, 13 Jul 2022 14:19:10 +0000 (10:19 -0400)] 
Version 1.8.2 placeholder

3 years ago- 1.8.1 rel_1_8_1
Mike Bayer [Wed, 13 Jul 2022 14:17:20 +0000 (10:17 -0400)] 
- 1.8.1

3 years agobuild fixes
Mike Bayer [Wed, 13 Jul 2022 14:02:53 +0000 (10:02 -0400)] 
build fixes

* hardcode rev ids in test that's sensitive to overlapping
  substrings
* turn off nitpicky mode
* fix a few rst keywords
* ensure unreleased files not considered as indexable

Change-Id: I31a0f2cbf40c794204c1e7dbc68bfcf43992c65f

3 years agoimplement SQLite RENAME TABLE w schema syntax
Mike Bayer [Tue, 12 Jul 2022 23:36:57 +0000 (19:36 -0400)] 
implement SQLite RENAME TABLE w schema syntax

Fixed bug where the SQLite implementation of
:meth:`.Operations.rename_table` would render an explicit schema name for
both the old and new table name, which while is the standard ALTER syntax,
is not accepted by SQLite's syntax which doesn't support a rename across
schemas. In particular, the syntax issue would prevent batch mode from
working for SQLite databases that made use of attached databases (which are
treated as "schemas" in SQLAlchemy).

Change-Id: I02d8163b39cd33568c7528158218828ff0813695
Fixes: #1065
3 years agoadd FUNDING
Mike Bayer [Wed, 6 Jul 2022 17:01:42 +0000 (13:01 -0400)] 
add FUNDING

Change-Id: I5fabab14fd88092dd622b7f575c0209b5fb46c7c

3 years agoignore typing issue
Mike Bayer [Fri, 1 Jul 2022 18:38:57 +0000 (14:38 -0400)] 
ignore typing issue

Change-Id: Idb07f3aaa172a216055309876acd7a6ddb1d325a

3 years agofail gracefully for batch_alter_table() called in --sql mode
Mike Bayer [Fri, 1 Jul 2022 13:56:10 +0000 (09:56 -0400)] 
fail gracefully for batch_alter_table() called in --sql mode

Added an error raise for the condition where
:meth:`.Operations.batch_alter_table` is used in ``--sql`` mode, where the
operation requires table reflection, as is the case when running against
SQLite without giving it a fixed ``Table`` object. Previously the operation
would fail with an internal error.   To get a "move and copy" batch
operation as a SQL script without connecting to a database,
a ``Table`` object should be passed to the
:paramref:`.Operations.batch_alter_table.copy_from` parameter so that
reflection may be skipped.

Change-Id: I2d040e7e5771eefabba1649d71ed451567c25283
Fixes: #1021
3 years agofix typo in setup.cfg
CaselIT [Mon, 27 Jun 2022 20:38:11 +0000 (22:38 +0200)] 
fix typo in setup.cfg

Change-Id: I06bd0183a8931eec193f1007ea4f3b9016f9dec0

3 years agouse license_files instead of the deprecated license_file
CaselIT [Mon, 27 Jun 2022 20:35:17 +0000 (22:35 +0200)] 
use license_files instead of the deprecated license_file

Change-Id: I065a30d89c2c7b0c78ddd4f3e51770ab08d7dd95

3 years agoMake alembic compatible with comments on constraints
CaselIT [Sat, 25 Jun 2022 21:19:20 +0000 (23:19 +0200)] 
Make alembic compatible with comments on constraints

Make alembic test compatible with comments on constraint change
added in Ia60f578595afdbd6089541c9a00e37997ef78ad3

Change-Id: I9ad803df1d3ccf2a5111266b781061936717b8c8

3 years agodocs(cookbook): add note on including info object on declarative tables (#1051)
Jack Michaud [Tue, 7 Jun 2022 18:38:04 +0000 (11:38 -0700)] 
docs(cookbook): add note on including info object on declarative tables (#1051)

3 years agoMerge "Annotate batch_alter_table" into main
mike bayer [Sat, 4 Jun 2022 15:51:07 +0000 (15:51 +0000)] 
Merge "Annotate batch_alter_table" into main

3 years agoRemove redundant wheel dep from pyproject.toml (#1047)
Michał Górny [Sat, 4 Jun 2022 12:05:44 +0000 (14:05 +0200)] 
Remove redundant wheel dep from pyproject.toml (#1047)

Remove the redundant `wheel` dependency, as it is added by the backend
automatically.  Listing it explicitly in the documentation was
a historical mistake and has been fixed since, see:
https://github.com/pypa/setuptools/commit/f7d30a9529378cf69054b5176249e5457aaf640a

3 years agoAnnotate batch_alter_table
CaselIT [Sat, 4 Jun 2022 09:59:23 +0000 (05:59 -0400)] 
Annotate batch_alter_table

Fixes: #975
Closes: #1032
Pull-request: https://github.com/sqlalchemy/alembic/pull/1032
Pull-request-sha: a111d4f446e861bd01a3cea7ebd1c18a2446601a

Change-Id: Idb8e1c8b6577204a64cde195f094830cdbba68ce

3 years agochore: Set permissions for GitHub actions (#1035)
nathannaveen [Sat, 4 Jun 2022 09:10:22 +0000 (04:10 -0500)] 
chore: Set permissions for GitHub actions (#1035)

Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
3 years agoVersion 1.8.1 placeholder
Mike Bayer [Tue, 31 May 2022 21:13:08 +0000 (17:13 -0400)] 
Version 1.8.1 placeholder

3 years ago- 1.8.0 rel_1_8_0
Mike Bayer [Tue, 31 May 2022 21:11:14 +0000 (17:11 -0400)] 
- 1.8.0

3 years agoMerge "Trigger events before and after drop table statements" into main
mike bayer [Tue, 31 May 2022 21:09:27 +0000 (21:09 +0000)] 
Merge "Trigger events before and after drop table statements" into main

3 years agoTrigger events before and after drop table statements
Adrien Berchet [Tue, 31 May 2022 12:31:25 +0000 (08:31 -0400)] 
Trigger events before and after drop table statements

The ``op.drop_table()`` operation directive will now trigger the
``before_drop()`` and ``after_drop()`` DDL event hooks at the table level,
which is similar to how the ``before_create()`` and ``after_create()``
hooks are triggered by the ``op.create_table()`` directive. Note that as
``op.drop_table()`` accepts only a table name and optional schema name, the
``Table`` object received by the event will not have any information within
it other than the table name and schema name.

Fixes: #1037
Closes: #1036
Pull-request: https://github.com/sqlalchemy/alembic/pull/1036
Pull-request-sha: ea44e7f3398aa5001e86e6a7e30f61f6a86d9674

Change-Id: I20a1702e17ed88054206d964152ce05b81d0f89e

3 years agoremove pylons template
Mike Bayer [Tue, 31 May 2022 20:18:57 +0000 (16:18 -0400)] 
remove pylons template

also some other doc updates
Fixes: #987
Change-Id: Icf3513201a4e26296cef15e2d6b3703759f6e831

3 years agothis will be 1.8.0
Mike Bayer [Tue, 31 May 2022 20:09:27 +0000 (16:09 -0400)] 
this will be 1.8.0

Change-Id: Ic258b7ca090cbe7158e7f0b9da8a42e809ae333a

3 years agoimplement full copy for indexes in batch
Mike Bayer [Tue, 10 May 2022 12:39:57 +0000 (08:39 -0400)] 
implement full copy for indexes in batch

Fixed issue in batch mode where CREATE INDEX would not use a new column
name in the case of a column rename.

Indexes were previously being moved to the new table without any
steps to rewrite columns.   We now vendor the copy approach
from table.to_metadata so that there's a new index expressed
in terms of the new columns.

Change-Id: Ied84232037aee0b2bf2094b3d3474013d7b41b34
Fixes: #1034
3 years agoMerge "Use pep517 to install alembic." into main
mike bayer [Sat, 7 May 2022 14:49:15 +0000 (14:49 +0000)] 
Merge "Use pep517 to install alembic." into main

3 years agoMerge "Alembic 1.8 now supports Python 3.7 and above" into main
mike bayer [Sat, 7 May 2022 14:48:19 +0000 (14:48 +0000)] 
Merge "Alembic 1.8 now supports Python 3.7 and above" into main

3 years agoUse pep517 to install alembic.
CaselIT [Fri, 20 Mar 2020 21:37:01 +0000 (22:37 +0100)] 
Use pep517 to install alembic.

Change-Id: If7b9e9fca39e6a6abe45900ff396345c778bbaa9

3 years agoAdd epoch as an option for file_template
Caio Carvalho [Tue, 3 May 2022 17:20:18 +0000 (13:20 -0400)] 
Add epoch as an option for file_template

Added new token ``epoch`` to the ``file_template`` option, which will
populate the integer epoch as determined by ``int(create_date.timestamp())``.
Pull request courtesy Caio Carvalho.

Fixes: #1027
Closes: #1028
Pull-request: https://github.com/sqlalchemy/alembic/pull/1028
Pull-request-sha: 27970cd5d4e047cb7aabd161c68b757b2ee3e4c4

Change-Id: I73e13009bae91e64681a605b3f0b62ea1e5fc464

3 years agoAlembic 1.8 now supports Python 3.7 and above
CaselIT [Mon, 2 May 2022 19:11:39 +0000 (21:11 +0200)] 
Alembic 1.8 now supports Python 3.7 and above

Fixes: #1025
Change-Id: I7c7050afc2291a07a08d454a1b8f8b192768d068

3 years agoFix downgrade with effective head
CaselIT [Mon, 2 May 2022 20:53:39 +0000 (22:53 +0200)] 
Fix downgrade with effective head

Fixed issue where downgrade using a relative revision would
fail in case of multiple branches with a single effectively
head due to interdependencies between revisions.

Fixes: #1026
Change-Id: I79f5595fb9d03124db8039345055571a9134eecd

3 years agoVarious typing related updates
CaselIT [Thu, 21 Apr 2022 21:23:00 +0000 (23:23 +0200)] 
Various typing related updates

Change-Id: I778b63b1c438f31964d841576f0dd54ae1a5fadc

3 years agoUse `-> None` in script templates by default
Nikita Sobolev [Thu, 21 Apr 2022 16:39:08 +0000 (12:39 -0400)] 
Use `-> None` in script templates by default

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

### Description

When working together with `mypy` we have a problem with the default template.
`mypy` raises errors on all migrations when used with https://mypy.readthedocs.io/en/stable/config_file.html#confval-disallow_untyped_defs

So, there are several options:
1. Remove this flag for `[mypy-db.alembic.*]` in `mypy.ini`. This is not a very good idea, because custom code that might get written in this directory might be not fully typed.
2. Edit our own template. This is what we end up doing right now, but this requires some manual work and many users might miss it
3. Update the source! I think that this is harmless (because only python3.6+ is supported), but allows better type-checking

### Checklist

Openning this as a draft for now. Will fix tests after I can see what is failing in the CI.
Issue is also on its way! 🙂

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

Fixes https://github.com/sqlalchemy/alembic/issues/764

**Have a nice day!**

Closes: #1012
Pull-request: https://github.com/sqlalchemy/alembic/pull/1012
Pull-request-sha: c1d17b202f414a97e6215cc2a513509462a9db09

Change-Id: Ib077157b5ebd697bf648644a954ed5a9a3b33080

3 years agodocument argparse limitation
Mike Bayer [Tue, 19 Apr 2022 12:51:36 +0000 (08:51 -0400)] 
document argparse limitation

Change-Id: I30257b346c3e3b518d63a80e495d354103063fa9
Fixes: #1020
3 years agoDocument config for migration files timestamp prefixed
Elias Dorneles [Wed, 6 Apr 2022 14:42:36 +0000 (10:42 -0400)] 
Document config for migration files timestamp prefixed

See discussion in issue: https://github.com/sqlalchemy/alembic/issues/1011

### Description

Summary of changes:

* updated `alembic.ini` templates
* updated tutorial accordingly

### Checklist

This pull request is:

- [x] A documentation / typographical error fix
- [ ] A short code fix
- [ ] A new feature implementation

Closes: #1013
Pull-request: https://github.com/sqlalchemy/alembic/pull/1013
Pull-request-sha: 34f06ac0a59a6207cf132f9ae5fdc9bc4780f404

Change-Id: Ia51441c9ec39a43a0ecc1270a40859af014b326c

3 years agobump black to 22.3.0
Mike Bayer [Mon, 28 Mar 2022 19:50:29 +0000 (15:50 -0400)] 
bump black to 22.3.0

both black and click were released in the past
few hours, and black 21.5b1 seems to suddenly
be failing on a missing symbol from click.  just
update to the latest

Change-Id: Icb9d98d6473aa603aa29ad1c2d1e43ff3b371db5

3 years agoadapt for column collection being "immutable" or "readonly"
Mike Bayer [Sat, 26 Mar 2022 15:47:29 +0000 (11:47 -0400)] 
adapt for column collection being "immutable" or "readonly"

in 2.0 the ColumnCollectionConstraint will use a
"read only" column collection, renamed from "immutable".
Add logic to detect both of these kinds of collections

Change-Id: I4049c3081a2b3801ea7bfa31bb62bafb3eae4a9d

3 years agoadd covering index tests; generalize autogen index tests
Mike Bayer [Wed, 16 Mar 2022 14:55:46 +0000 (10:55 -0400)] 
add covering index tests; generalize autogen index tests

In response to #1006, add tests for covering indexes
for PostgreSQL and MSSQL.

Refactor test_autogen_indexes to be generalized for all
backends.  Parts of this test module should eventually move
to the suite tests.

Fixes: #1006
Change-Id: I126b0bcbf4f065e5b148567929fece898e66821e

3 years agoVersion 1.7.8 placeholder
Mike Bayer [Mon, 14 Mar 2022 19:41:19 +0000 (15:41 -0400)] 
Version 1.7.8 placeholder

3 years ago- 1.7.7 rel_1_7_7
Mike Bayer [Mon, 14 Mar 2022 19:39:01 +0000 (15:39 -0400)] 
- 1.7.7

3 years agochangelog updates
Mike Bayer [Mon, 14 Mar 2022 19:38:01 +0000 (15:38 -0400)] 
changelog updates

Change-Id: I6e1bcdab140eb91926520984e6fc2c288f1dade1

3 years agoadd sphinx_copybutton
Mike Bayer [Mon, 14 Mar 2022 19:33:15 +0000 (15:33 -0400)] 
add sphinx_copybutton

Change-Id: I14471e98a876982b4fcfdfab35c3150ab0b18bde

3 years agoFix duplicated constraints when using expressions
Nicolas CANIART [Sun, 13 Mar 2022 16:39:40 +0000 (12:39 -0400)] 
Fix duplicated constraints when using expressions

Fixed issue where using :meth:`.Operations.create_table` in conjunction
with a :class:`.CheckConstraint` that referred to table-bound
:class:`.Column` objects rather than string expressions would be added to
the parent table twice, resulting in an incorrect DDL sequence. Pull
request courtesy Nicolas CANIART.

Fixes: #1004
Closes: #1005
Pull-request: https://github.com/sqlalchemy/alembic/pull/1005
Pull-request-sha: 2fe5c5297bcde990096571a047039c451aa876f6

Change-Id: I2bf48701968fe59a6766f8f8879320b1bfd75774

3 years agofix failing test on windows after sqlite switched to queuepool by default
CaselIT [Mon, 28 Feb 2022 23:21:17 +0000 (00:21 +0100)] 
fix failing test on windows after sqlite switched to queuepool by default

Change-Id: Iec2b2ae9c2df9592988fa2239b768d1919eec297

3 years agodesensitize Oracle to FLOAT/DOUBLE/DOUBLE_PRECISION differences
Mike Bayer [Wed, 2 Mar 2022 01:56:46 +0000 (20:56 -0500)] 
desensitize Oracle to FLOAT/DOUBLE/DOUBLE_PRECISION differences

Oracle Float will come back as DOUBLE_PRECISION
as a result of https://github.com/sqlalchemy/sqlalchemy/issues/5465.
Add some synonyms to prevent changes between these names from resulting
in autogenerate positives.

Change-Id: I6cdda7ff660ecf92884c18c663aef1c143a58da7

3 years agomore links to pypi, add 3.10 to classifiers
CaselIT [Mon, 28 Feb 2022 20:12:58 +0000 (21:12 +0100)] 
more links to pypi, add 3.10 to classifiers

Change-Id: I9af924f6d28ebbfc1186b5369655bed7d3348766

3 years agoadd GitHub URL for PyPi (#994)
Andrii Oriekhov [Mon, 28 Feb 2022 20:08:56 +0000 (22:08 +0200)] 
add GitHub URL for PyPi (#994)

3 years agoillustrate connection sharing + asyncio
Mike Bayer [Tue, 15 Feb 2022 18:06:57 +0000 (13:06 -0500)] 
illustrate connection sharing + asyncio

References: #991
:

Change-Id: I4d1d738ab27a541618762240888dd45284867720

3 years agorepair sharing example
Mike Bayer [Tue, 15 Feb 2022 14:18:50 +0000 (09:18 -0500)] 
repair sharing example

the note re: "we dont have to guess" is wrong.
engine_from_config() returns an engine.   It seems
like this example was edited a few times and
was not completely checked (it was me, for sure).

for now just use two separate blocks to eliminate
any problems

Change-Id: Ib44671526d0f570ed88dd3b1c77d078c1afbf3eb

3 years agofix connection handling in consumption test
Mike Bayer [Fri, 11 Feb 2022 15:33:09 +0000 (10:33 -0500)] 
fix connection handling in consumption test

these tests were leaving connections opened.

This rev is necessary for tests to pass assuming
QueuePool for SQLite file connections, in
I5f6c259def0ef43d401c6163dc99f651e519148d

Change-Id: I5f6c259def0ef43d401c6163dc99f651e519148d

3 years agoadd conditional for fileConfig()
Mike Bayer [Mon, 7 Feb 2022 19:52:03 +0000 (14:52 -0500)] 
add conditional for fileConfig()

The ``fileConfig()`` line in the ``env.py`` templates is now conditional on
``Config.config_file_name`` not being None.

Change-Id: Ibe943d093fd872c4d0a836f58e0608a4e078ce1f
Fixes: #986
3 years agoPrevent alter_column() from changing nullability
Gord Thompson [Thu, 13 Jan 2022 18:46:46 +0000 (11:46 -0700)] 
Prevent alter_column() from changing nullability

Fixed bug where an alter_column() operation would change a "NOT NULL"
column to "NULL" by emitting an ALTER COLUMN statement that did not specify
"NOT NULL". (In the absence of "NOT NULL" T-SQL was implicitly assuming
"NULL"). An alter_column() operation that specifies `type_=` should also
specify either `nullable=` or `existing_nullable=` to inform Alembic as to
whether the emitted DDL should include "NULL" or "NOT NULL"; a warning is
now emitted if this is missing under this scenario.

Fixes: #977
Change-Id: Ifbaa06bf149ba39d1a5deb43a6fd42c9ca118894

3 years agoclarify default configuration behavior
Mike Bayer [Fri, 4 Feb 2022 16:51:30 +0000 (11:51 -0500)] 
clarify default configuration behavior

alembic does not by default read other sections
besides ``[alembic]``, however the generated ``env.py``
file by default contains instructions to also read logging
directives.  clarify that if the configuration file is
customized to not have logging directives, env.py also
needs to be customized.

Change-Id: I4804ce54b78b68c2d72ba4bcc7c1ecaf93a09103
Fixes: #985
3 years agofix pep484 issue
Mike Bayer [Tue, 1 Feb 2022 15:35:23 +0000 (10:35 -0500)] 
fix pep484 issue

the jenkins pep484 job wasn't catching the tox target
so we missed a mypy failure that got released :/

Change-Id: Ibaee3158971985fb08e43a53f99244bcc4fa0f81

3 years agoVersion 1.7.7 placeholder
Mike Bayer [Tue, 1 Feb 2022 15:02:28 +0000 (10:02 -0500)] 
Version 1.7.7 placeholder

3 years ago- 1.7.6 rel_1_7_6
Mike Bayer [Tue, 1 Feb 2022 15:00:09 +0000 (10:00 -0500)] 
- 1.7.6

3 years agohappy new year
Mike Bayer [Tue, 1 Feb 2022 14:59:05 +0000 (09:59 -0500)] 
happy new year

Change-Id: Ieaacc9d126d88f54d585e6380dd6bd56aa5919c2

3 years agoresolve for variant before testing for schema type
Mike Bayer [Tue, 1 Feb 2022 14:12:17 +0000 (09:12 -0500)] 
resolve for variant before testing for schema type

Fixed regression where usage of a ``with_variant()`` datatype in
conjunction with the ``existing_type`` option of ``op.alter_column()``
under batch mode would lead to an internal exception.

note this exception would only occur under 1.x, under 2.0
the new variant architecture would have prevented this problem,
however it is best here that the ultimate variant type is
unwrapped in the case that we have a plain type with a
schema type as a variant.

also sqla 1.3 needs pytest < 7 to run correctly

Change-Id: I0f5480f97f014e707b8bd4e70f8495d3bd27fd21
Fixes: #982
3 years agoadd pep484 target
Mike Bayer [Thu, 20 Jan 2022 18:31:29 +0000 (13:31 -0500)] 
add pep484 target

this is now the mypy target that the jenkins gerrit
job will access.

Change-Id: Iaa2bdbe8c4da683d7704a50be8ff3d9e7f887e09

3 years agoInsert spaces in warning and error messages 976/head
Harutaka Kawamura [Tue, 11 Jan 2022 07:08:43 +0000 (16:08 +0900)] 
Insert spaces in warning and error messages

3 years agoProvide useful error message in stub tests
CaselIT [Wed, 1 Dec 2021 21:11:36 +0000 (22:11 +0100)] 
Provide useful error message in stub tests

Change-Id: I6d2662cb5c13d5438210aa001cbdb8c7eb876bb7

3 years agoRemove warning regarding cache key when using MSSQL.
CaselIT [Tue, 28 Dec 2021 21:15:32 +0000 (22:15 +0100)] 
Remove warning regarding cache key when using MSSQL.

Change-Id: I5eacf7c2030d8dbdaf1e5d2eba836a7596365ae3

3 years agoadd missing import in asyncion cookbook example
CaselIT [Tue, 21 Dec 2021 19:27:01 +0000 (20:27 +0100)] 
add missing import in asyncion cookbook example

Change-Id: Idda470d2aa7df298e5553359be1ced07e2c112d0

3 years agofix type errors raised by mypy .920
CaselIT [Tue, 21 Dec 2021 19:17:39 +0000 (20:17 +0100)] 
fix type errors raised by mypy .920

Change-Id: Ifca989610193074757dec6602af268ea5139c4bc

3 years agodocs: Add missing engine.dispose() call to the asyncio cookbook example. (#973)
DanCardin [Tue, 21 Dec 2021 19:07:23 +0000 (14:07 -0500)] 
docs: Add missing engine.dispose() call to the asyncio cookbook example. (#973)

3 years agoRemove usage of no longer needed compat code
CaselIT [Tue, 23 Nov 2021 20:51:23 +0000 (21:51 +0100)] 
Remove usage of no longer needed compat code

Change-Id: I3180931673496260614e69e95f7da09d68b51714

3 years agoMerge remote-tracking branch 'github/pr/969'
Mike Bayer [Tue, 23 Nov 2021 16:22:43 +0000 (11:22 -0500)] 
Merge remote-tracking branch 'github/pr/969'

Change-Id: Ic6c07a214e372464c1d6303317caf98cfc3b0edf

3 years agoTweak docs about version_path_separator 969/head
Vlastimil Zíma [Thu, 18 Nov 2021 09:27:15 +0000 (10:27 +0100)] 
Tweak docs about version_path_separator

3 years agoMerge "Add new ensure_version command" into main
mike bayer [Thu, 18 Nov 2021 21:10:09 +0000 (21:10 +0000)] 
Merge "Add new ensure_version command" into main

3 years agoAdd new ensure_version command
Kai Mueller [Wed, 10 Nov 2021 16:38:11 +0000 (11:38 -0500)] 
Add new ensure_version command

Add a new command ``alembic ensure_version``, which will ensure that the
Alembic version table is present in the target database, but does not
alter its contents.  Pull request courtesy Kai Mueller.

Fixes: #964
Closes: #965
Pull-request: https://github.com/sqlalchemy/alembic/pull/965
Pull-request-sha: a85d2ac048c666126e583fbda482eeabd9c58c53

Change-Id: Ia39d43287634915537725e779dba7ac34f2946e4

3 years agoMerge "add type synonym for mysql.LONGTEXT / JSON" into main
mike bayer [Thu, 18 Nov 2021 15:54:27 +0000 (15:54 +0000)] 
Merge "add type synonym for mysql.LONGTEXT / JSON" into main

3 years agosupport 2.0 style variants
Mike Bayer [Tue, 16 Nov 2021 19:10:58 +0000 (14:10 -0500)] 
support 2.0 style variants

Implemented support for recognizing and rendering SQLAlchemy "variant"
types going forward into SQLAlchemy 2.0, where the architecture of
"variant" datatypes will be changing.

Specifically any TypeEngine can now have "variants" by looking
in the _variant_mapping dictionary collection associated with the
type directly.

Change-Id: I0b5ca887dce1dd77af3504dbe318701b31c7d574

3 years agoadd type synonym for mysql.LONGTEXT / JSON
Mike Bayer [Sat, 13 Nov 2021 15:27:30 +0000 (10:27 -0500)] 
add type synonym for mysql.LONGTEXT / JSON

Added a rule to the MySQL impl so that the translation between JSON /
LONGTEXT is accommodated by autogenerate, treating LONGTEXT from the server
as equivalent to an existing JSON in the model.

Change-Id: Ia8370d2269c4decea00aa94beafd3d9d861a1269
Fixes: #968
3 years agoVersion 1.7.6 placeholder
Mike Bayer [Thu, 11 Nov 2021 15:56:19 +0000 (10:56 -0500)] 
Version 1.7.6 placeholder

3 years ago- 1.7.5 rel_1_7_5
Mike Bayer [Thu, 11 Nov 2021 15:55:00 +0000 (10:55 -0500)] 
- 1.7.5

3 years agoUpdate documentation about alembic configuration path 966/head
Madison Swain-Bowden [Thu, 11 Nov 2021 00:14:43 +0000 (16:14 -0800)] 
Update documentation about alembic configuration path

3 years agoadjust autocommit tests to accommodate for execution_options change
Mike Bayer [Fri, 5 Nov 2021 20:58:27 +0000 (16:58 -0400)] 
adjust autocommit tests to accommodate for execution_options change

the tests here were relying on the fact that execution_options
returns a new connection which is not the case for future mode.

Change-Id: Ib6c2c69243a615fa2097c68fc5c35c14507bea61

3 years agouse a heuristic for pure "future engine" until future engine merges
Mike Bayer [Fri, 5 Nov 2021 16:19:12 +0000 (12:19 -0400)] 
use a heuristic for pure "future engine" until future engine merges

Change-Id: I0d5605091c3010ce50bcd0083dfb3c9615212d22

3 years agosqlalchemy 2.0 test updates
Mike Bayer [Fri, 5 Nov 2021 15:24:23 +0000 (11:24 -0400)] 
sqlalchemy 2.0 test updates

- disable branched connection tests for 2.x
- dont use future flag for 2.x
- adjust batch tests for autobegin, inconsistent
  SQLite transactional DDL behaviors

Change-Id: I70caf6afecc83f880dc92fa6cbc29e2043c43bb9

3 years agofix annotation
Mike Bayer [Fri, 5 Nov 2021 04:05:07 +0000 (00:05 -0400)] 
fix annotation

Change-Id: Iae921dd45d78e9c657304a2977adb18b0191a20d

3 years agorollback connection before teardown
Mike Bayer [Fri, 5 Nov 2021 03:49:15 +0000 (23:49 -0400)] 
rollback connection before teardown

this test needs to clear out the transaction
if running on SQLAlchemy 2.0.

Change-Id: Ic3f76433ba9b9ea5485a81caae745d3c7f2a4ee8