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

3 years agoworkflow: also test against rel_1_4
CaselIT [Thu, 4 Nov 2021 20:50:07 +0000 (21:50 +0100)] 
workflow: also test against rel_1_4

Change-Id: I68c8a06c9d8baefdb6736e701be33b730eff7442

3 years agoworkflows; skip py3.6 when testing against main, add py3.10
CaselIT [Thu, 4 Nov 2021 20:37:47 +0000 (21:37 +0100)] 
workflows; skip py3.6 when testing against main, add py3.10

Change-Id: Ia847a906ed64a3a9bef4c8a72b732e1c156e9a85

3 years agodont hardcode transaction opened messaging
Mike Bayer [Thu, 4 Nov 2021 18:34:07 +0000 (14:34 -0400)] 
dont hardcode transaction opened messaging

Adjustments to the test suite to accommodate for error message changes
occurring as of SQLAlchemy 1.4.27.

Change-Id: I5092c8d3ba3d16819b200f1dfc3c30b8d24abe30

3 years agoRemove code to force ENABLE_ASYNCIO to False
Gord Thompson [Sat, 23 Oct 2021 17:24:40 +0000 (11:24 -0600)] 
Remove code to force ENABLE_ASYNCIO to False

Forcing ENABLE_ASYNCIO to False was interfering
with testing under async drivers when the
(third-party dialect) test suite included both
SQLAlchemy and Alembic tests.

Change-Id: I2fe40049c24ba8eba0a10011849a912c03aa381e

3 years agoAdjust test requirements for mssql
Gord Thompson [Sat, 23 Oct 2021 22:41:19 +0000 (16:41 -0600)] 
Adjust test requirements for mssql

SQLAlchemy added FK onupdate/ondelete reflection
in 1.4.26

Change-Id: Ie4e95294fe3857ea1f28a67a7a78ca9213e8e8f8

3 years agoensure connection is not None
Mike Bayer [Sat, 23 Oct 2021 19:58:37 +0000 (15:58 -0400)] 
ensure connection is not None

the inspect() API changed in
https://github.com/sqlalchemy/sqlalchemy2-stubs/commit/68f8417888456588714fcced1c6799f3eb00ff2d
to be more accurate which correctly appears to necessitate a
type check in Alembic AutogenContext.inspector() to ensure
"self.connection" isn't None

Change-Id: Icb3c73be62dc14d9a8f88e0723c3651b6628739a

3 years agomain name for github workflows
Mike Bayer [Mon, 11 Oct 2021 16:18:20 +0000 (12:18 -0400)] 
main name for github workflows

Change-Id: I0c32212f1b96acb691c29f013cfa78e1ae228cfc

3 years agorename to main
Mike Bayer [Mon, 11 Oct 2021 15:28:04 +0000 (11:28 -0400)] 
rename to main

Change-Id: I6cff33e68cbb2735f3fda22433c36e565a3d5e7a

3 years agoFix issue 928 create_check_constraint condition argument typing fix (#929)
liverpool1026 [Thu, 7 Oct 2021 19:46:58 +0000 (05:46 +1000)] 
Fix issue 928 create_check_constraint condition argument typing fix (#929)

* Update create_check_constraint method typing

* Pass str type down

Fixes: #928
Co-authored-by: Kevin Hwa <liverpoo1026.bne@gmail.com>
Co-authored-by: Kevin Hwa <kevin.hwa@polymathian.com>
3 years agoAdd `[post_write_hooks]` to example `alembic.ini` 946/head
Anatoli Babenia [Thu, 7 Oct 2021 06:47:32 +0000 (09:47 +0300)] 
Add `[post_write_hooks]` to example `alembic.ini`

3 years agoVersion 1.7.5 placeholder
Mike Bayer [Wed, 6 Oct 2021 14:31:50 +0000 (10:31 -0400)] 
Version 1.7.5 placeholder

3 years ago- 1.7.4 rel_1_7_4
Mike Bayer [Wed, 6 Oct 2021 14:13:39 +0000 (10:13 -0400)] 
- 1.7.4

3 years agoMerge "frame a transaction around autocommit"
mike bayer [Tue, 5 Oct 2021 13:25:23 +0000 (13:25 +0000)] 
Merge "frame a transaction around autocommit"

3 years agoframe a transaction around autocommit
Mike Bayer [Mon, 4 Oct 2021 19:15:16 +0000 (15:15 -0400)] 
frame a transaction around autocommit

Fixed issue where the :meth:`.MigrationContext.autocommit_block` feature
would fail to function when using a SQLAlchemy engine using 2.0 future
mode.

Change-Id: I851573424c7cde2595ae22c816ec6580d7cab248
Fixes: #944
3 years agoFix write hook issue in python < 3.9.
Federico Caselli [Thu, 30 Sep 2021 13:06:13 +0000 (15:06 +0200)] 
Fix write hook issue in python < 3.9.

Adjust require of importlib_metadata also include py3.8.

Fixes: #934
Change-Id: Id64163a0dc53226d62795d40190b6cec0aee522b

3 years agoMultiDB README: Add a bit more detail 932/head
Chris Dary [Fri, 24 Sep 2021 19:47:08 +0000 (15:47 -0400)] 
MultiDB README: Add a bit more detail

3 years agoVersion 1.7.4 placeholder
Mike Bayer [Fri, 17 Sep 2021 15:29:34 +0000 (11:29 -0400)] 
Version 1.7.4 placeholder

3 years ago- 1.7.3 rel_1_7_3
Mike Bayer [Fri, 17 Sep 2021 15:28:22 +0000 (11:28 -0400)] 
- 1.7.3

3 years agoMerge "Fix constraint_name type of create_foreign_key"
mike bayer [Fri, 17 Sep 2021 15:27:41 +0000 (15:27 +0000)] 
Merge "Fix constraint_name type of create_foreign_key"

3 years agoVersion 1.7.3 placeholder
Mike Bayer [Fri, 17 Sep 2021 14:06:36 +0000 (10:06 -0400)] 
Version 1.7.3 placeholder

3 years ago- 1.7.2 rel_1_7_2
Mike Bayer [Fri, 17 Sep 2021 13:59:36 +0000 (09:59 -0400)] 
- 1.7.2

3 years agoFix constraint_name type of create_foreign_key
TilmanK [Tue, 14 Sep 2021 19:39:59 +0000 (15:39 -0400)] 
Fix constraint_name type of create_foreign_key

Fixed type annotations for the "constraint_name" argument of operations
``create_primary_key()``, ``create_foreign_key()``.  Pull request courtesy
TilmanK.

Closes: #914
Pull-request: https://github.com/sqlalchemy/alembic/pull/914
Pull-request-sha: 39d44af226b2103da3964daf3229880a0958b97c

Change-Id: Iec4b392c70ae0eeda06dcbfda95a2f044e976686

3 years agoMerge "render 3rd party module annotations as forward references"
mike bayer [Fri, 17 Sep 2021 13:23:00 +0000 (13:23 +0000)] 
Merge "render 3rd party module annotations as forward references"

3 years agorender 3rd party module annotations as forward references
Mike Bayer [Wed, 15 Sep 2021 20:43:45 +0000 (16:43 -0400)] 
render 3rd party module annotations as forward references

Fixed issue where registration of custom ops was prone to failure due to
the registration process running ``exec()`` on generated code that as of
the 1.7 series includes pep-484 annotations, which in the case of end user
code would result in name resolution errors when the exec occurs. The logic
in question has been altered so that the annotations are rendered as
forward references so that the ``exec()`` can proceed.

Change-Id: I142b89e2f6354b2ce253f3b8109f59fa3aae68ef
Fixes: #920
3 years agoAdded missing attributes from context stubs.
CaselIT [Mon, 6 Sep 2021 21:22:30 +0000 (23:22 +0200)] 
Added missing attributes from context stubs.

Fixes: #900
Change-Id: I2e21b6f363bf6405bd472c9aca04fbbc3c9cc384

3 years agoAdds exception when trying to run write_pyi.py with Python < 3.9
TilmanK [Tue, 14 Sep 2021 19:43:30 +0000 (15:43 -0400)] 
Adds exception when trying to run write_pyi.py with Python < 3.9

### Description
write_pyi.py now raises an exception when someone tries to run the script with Python version 3.8 or smaller.

This also fixes:
- When using absolute Paths, i.e. on Windows, they are now converted to relative paths to avoid useless changes in the doc strings of the pyi files
- Corrected destination_path argument type when calling `generate_pyi_for_proxy` in `run_file`
- A comment typo

Fixes: #915
Closes: #919
Pull-request: https://github.com/sqlalchemy/alembic/pull/919
Pull-request-sha: e885d27ac5509858c8cb2927310f6195fc1d6004

Change-Id: Ia33d32b2828e71185186afc49848ce89d48a8323

3 years agoMerge "use in-package imports"
mike bayer [Tue, 14 Sep 2021 17:00:08 +0000 (17:00 +0000)] 
Merge "use in-package imports"

3 years agouse in-package imports
Mike Bayer [Mon, 13 Sep 2021 18:58:06 +0000 (14:58 -0400)] 
use in-package imports

Fixed an import in one of the .pyi files that was triggering an
assertion error in some versions of mypy.

Change-Id: Ifc663a876ebe5bebf8411c1eb451f2a25fe4dec0
Fixes: #897
3 years agoMerge branch 'workflow_test_mypy' into master-gerrit
CaselIT [Mon, 13 Sep 2021 19:19:07 +0000 (21:19 +0200)] 
Merge branch 'workflow_test_mypy' into master-gerrit
Change-Id: Ifb5f035a83341b4ccf0d615ab4d6ba23ca7f1573

3 years agoAdd mypy to the github workflow 918/head
CaselIT [Mon, 13 Sep 2021 19:11:22 +0000 (21:11 +0200)] 
Add mypy to the github workflow

Fixes: #917
Change-Id: I77d8a3673eb6d990ca947c59f6960925561d122a

3 years agoMerge remote-tracking branch 'github/pr/911'
Mike Bayer [Mon, 13 Sep 2021 18:48:50 +0000 (14:48 -0400)] 
Merge remote-tracking branch 'github/pr/911'

Change-Id: Id661e1e1f81e0ab8e17dab2479d9223e425f471b

3 years agoFix/typos doc build (#910)
Kevin Kirsche [Sat, 11 Sep 2021 20:39:08 +0000 (16:39 -0400)] 
Fix/typos doc build (#910)

* fix: typos in docs/build/batch.rst

* fix: typos in docs/build/autogenerate.rst

* fix: typos in docs/build/changelog.rst

3 years agofix: typos in doc/build/api (#909)
Kevin Kirsche [Sat, 11 Sep 2021 20:37:23 +0000 (16:37 -0400)] 
fix: typos in doc/build/api (#909)

3 years ago[DOCS]: Remove suggestion to use branched connections 911/head
Chris Sewell [Sat, 11 Sep 2021 06:12:10 +0000 (08:12 +0200)] 
[DOCS]: Remove suggestion to use branched connections

Fixes #908

3 years agoadd missing resources from alembic doc build
Mike Bayer [Thu, 9 Sep 2021 12:27:21 +0000 (08:27 -0400)] 
add missing resources from alembic doc build

Change-Id: I0f1c3a67edf35ab9ea2b0ac0689f68e8b4dee99d
Fixes: #907
3 years agoclarify that only named check constraints are regenerated
Mike Bayer [Wed, 1 Sep 2021 14:57:00 +0000 (10:57 -0400)] 
clarify that only named check constraints are regenerated

Change-Id: Ie0489137122d6ccedfa7c1af44dc8420a0842ee8
References: #400

3 years agoVersion 1.7.2 placeholder
Mike Bayer [Mon, 30 Aug 2021 21:51:30 +0000 (17:51 -0400)] 
Version 1.7.2 placeholder

3 years ago- 1.7.1 rel_1_7_1
Mike Bayer [Mon, 30 Aug 2021 21:49:50 +0000 (17:49 -0400)] 
- 1.7.1

3 years agocheck all directives in batch block until recreate selected
Mike Bayer [Mon, 30 Aug 2021 20:02:02 +0000 (16:02 -0400)] 
check all directives in batch block until recreate selected

Fixed regression in batch mode due to :ticket:`883` where the "auto" mode
of batch would fail to accommodate any additional migration directives
beyond encountering an ``add_column()`` directive, due to a mis-application
of the conditional logic that was added as part of this change, leading to
"recreate" mode not being used in cases where it is required for SQLite
such as for unique constraints.

Change-Id: I6315569caff5f3b33d152974ebecc8b18d9cc523
Fixes: #896
3 years agorestore default values for keyword arguments in stubs
Mike Bayer [Mon, 30 Aug 2021 18:30:37 +0000 (14:30 -0400)] 
restore default values for keyword arguments in stubs

Fixed issue in generated .pyi files where default values for ``Optional``
arguments were missing, thereby causing mypy to consider them as required.

Change-Id: I08c4cd7bd04c6763fdc9c5b42abbdcca8fd90e0e
Fixes: #895
3 years agofix mypy errors
CaselIT [Mon, 30 Aug 2021 19:39:40 +0000 (21:39 +0200)] 
fix mypy errors

Change-Id: If49e0ff00f0b00ed914ddb8979ae49c3a8a10a0e

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