]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
2 years agoVersion 1.9.5 placeholder
Mike Bayer [Thu, 16 Feb 2023 17:38:03 +0000 (12:38 -0500)] 
Version 1.9.5 placeholder

2 years ago- 1.9.4 rel_1_9_4
Mike Bayer [Thu, 16 Feb 2023 17:35:31 +0000 (12:35 -0500)] 
- 1.9.4

2 years agoMerge "dont use server_default render_item for SQL compare" into main
mike bayer [Thu, 16 Feb 2023 15:10:29 +0000 (15:10 +0000)] 
Merge "dont use server_default render_item for SQL compare" into main

2 years agoMerge "collapse all chars for mssql defaults, move quoting" into main
mike bayer [Thu, 16 Feb 2023 15:10:23 +0000 (15:10 +0000)] 
Merge "collapse all chars for mssql defaults, move quoting" into main

2 years agodont use server_default render_item for SQL compare
Mike Bayer [Thu, 16 Feb 2023 02:34:30 +0000 (21:34 -0500)] 
dont use server_default render_item for SQL compare

Removed a mis-use of the
:paramref:`.EnvironmentContext.configure.render_item` callable where the
"server_default" renderer would be erroneously used within the server
default comparison process, which is working against SQL expressions, not
Python code.

Change-Id: Id6fad1e6f5ac0a68bbd0e6b7e6088e451bf6dc2b
References: #641
Fixes: #1180
2 years agoMerge "restore config object to merge command" into main
mike bayer [Wed, 15 Feb 2023 18:22:05 +0000 (18:22 +0000)] 
Merge "restore config object to merge command" into main

2 years agocollapse all chars for mssql defaults, move quoting
Mike Bayer [Tue, 14 Feb 2023 17:45:24 +0000 (12:45 -0500)] 
collapse all chars for mssql defaults, move quoting

Ongoing fixes for SQL Server server default comparisons under autogenerate,
adjusting for SQL Server's collapsing of whitespace between SQL function
arguments when reporting on a function-based server default, as well as its
arbitrary addition of parenthesis within arguments; the approach has now
been made more aggressive by stripping the two default strings to compare
of all whitespace, parenthesis, and quoting characters.

Fixed PostgreSQL server default comparison to handle SQL expressions
sent as ``text()`` constructs, such as ``text("substring('name', 1, 3)")``,
which previously would raise errors when attempting to run a server-based
comparison.

Change-Id: Icd861f62653fc7b3900164c0d047821125e1305e
Fixes: #1177
2 years agoFollow up Ia98c8f9a93953f049378f5029e355a3f249ed638
CaselIT [Tue, 14 Feb 2023 20:52:33 +0000 (21:52 +0100)] 
Follow up Ia98c8f9a93953f049378f5029e355a3f249ed638
that was merged prematurely

Change-Id: I131dfb8dabf10457954f5216b1abadc976aebd38

2 years agorestore config object to merge command
Brendan Gann [Tue, 14 Feb 2023 16:03:09 +0000 (11:03 -0500)] 
restore config object to merge command

Fixed regression introduced in 1.7.0 where the "config" object passed to
the template context when running the :func:`.merge` command
programmatically failed to be correctly populated. Pull request courtesy
Brendan Gann.

Closes: #1176
Pull-request: https://github.com/sqlalchemy/alembic/pull/1176
Pull-request-sha: cf6a886915f6bef6eeef8041804e316038955402

Change-Id: Idbab2dc0339cce6f8827d2f49156791600a82c1a

2 years agoMerge "Update annotation to allow PathLike" into main
mike bayer [Tue, 14 Feb 2023 15:46:06 +0000 (15:46 +0000)] 
Merge "Update annotation to allow PathLike" into main

2 years agoInclude missing part of env.py
Sam Bull [Mon, 13 Feb 2023 20:36:06 +0000 (15:36 -0500)] 
Include missing part of env.py

This part is missing from the example, and if a user started with the async template, then they would have an `asyncio.run()` call in here, which breaks the script.

Fixes: #1174
Closes: #1172
Pull-request: https://github.com/sqlalchemy/alembic/pull/1172
Pull-request-sha: fa2c55319d09fab4e1435433fa2d7e5fca5dc820

Change-Id: Ia98c8f9a93953f049378f5029e355a3f249ed638

2 years agoUpdate annotation to allow PathLike
Sam Bull [Mon, 13 Feb 2023 20:57:29 +0000 (15:57 -0500)] 
Update annotation to allow PathLike

The value is only used in os.path.abspath(), so it works fine with Path.

Closes: #1173
Pull-request: https://github.com/sqlalchemy/alembic/pull/1173
Pull-request-sha: 7cf9606602bb5692ddeb3551500be0dd956bd5d9

Change-Id: Ic629a7290464291377d066e856a8ae8a3f6505bc

2 years agouse correct param name
Mike Bayer [Mon, 13 Feb 2023 14:00:29 +0000 (09:00 -0500)] 
use correct param name

Change-Id: I2981335a5deaa798195cfe70f3655d79cd4d8a3b

2 years agopin sphinx-copybutton and change config
Mike Bayer [Thu, 9 Feb 2023 17:11:31 +0000 (12:11 -0500)] 
pin sphinx-copybutton and change config

sphinx-copybutton introduced a new feature
in 0.5.1 which includes a default configuration
that breaks the regexp prompt matching scheme.

set copybutton_exclude to not include ".gp" as that's the class
where we exactly look for the prompts we are matching.

pin sphinx-copybutton at 0.5.1 to avoid future problems.

Change-Id: Ie03bc27a9190e71b63fc68b484f23e53b8cb72dc
References: https://github.com/executablebooks/sphinx-copybutton/issues/185

2 years agoVersion 1.9.4 placeholder
Mike Bayer [Tue, 7 Feb 2023 20:48:43 +0000 (15:48 -0500)] 
Version 1.9.4 placeholder

2 years ago- 1.9.3 rel_1_9_3
Mike Bayer [Tue, 7 Feb 2023 20:47:07 +0000 (15:47 -0500)] 
- 1.9.3

2 years agoadd variant render step for user-defined types
Mike Bayer [Tue, 7 Feb 2023 04:30:58 +0000 (23:30 -0500)] 
add variant render step for user-defined types

due to SQLA 2.0's variant being integrated into types,
the variant rendering conditional would no longer take effect
as the type was not under the "sqlalchemy" module namespace.

Fixed issue where rendering of user-defined types that then went onto use
the ``.with_variant()`` method would fail to render, if using SQLAlchemy
2.0's version of variants.

Change-Id: I3c6f14325d6dffb2ddc1bf955753ee5a2de2cedd
Fixes: #1167
2 years agoRename teardown() method to avoid PytestRemovedIn8Warning
Gord Thompson [Wed, 25 Jan 2023 18:22:22 +0000 (11:22 -0700)] 
Rename teardown() method to avoid PytestRemovedIn8Warning

pytest 7.2.1 issuing PytestRemovedIn8Warning

[method name] is using nose-specific method: `teardown(self)`
To remove this warning, rename it to `teardown_method(self)`

Change-Id: I0674aaec2fe174ec16bedba7d524bc20fce6d219

2 years agoVersion 1.9.3 placeholder
Mike Bayer [Sat, 14 Jan 2023 19:15:45 +0000 (14:15 -0500)] 
Version 1.9.3 placeholder

2 years ago- 1.9.2 rel_1_9_2
Mike Bayer [Sat, 14 Jan 2023 19:11:02 +0000 (14:11 -0500)] 
- 1.9.2

2 years agoAdd commit to cookbook example
CaselIT [Wed, 11 Jan 2023 20:17:33 +0000 (21:17 +0100)] 
Add commit to cookbook example

A commit is now required to end the transaction before start
executing the migration

Fixes: #1150
Change-Id: I704db15155454dafed9d15f768b97f8e2ebfff81

2 years agorepair regression in SQL Server server default comapre logic
Mike Bayer [Tue, 10 Jan 2023 21:51:49 +0000 (16:51 -0500)] 
repair regression in SQL Server server default comapre logic

Fixed regression caused by :ticket:`1145` where the string transformations
applied to server defaults caused expressions such as ``(getdate())`` to no
longer compare as equivalent on SQL Server, others.

Change-Id: I9c611edd70765487746f652c9eb09e54d935da28
Fixes: #1152
2 years agoMerge "add overload stubs for proxied classes" into main
mike bayer [Tue, 3 Jan 2023 18:00:36 +0000 (18:00 +0000)] 
Merge "add overload stubs for proxied classes" into main

2 years agohappy new year 2023
Mike Bayer [Tue, 3 Jan 2023 17:51:53 +0000 (12:51 -0500)] 
happy new year 2023

Change-Id: Ia163c800e074443b92cd59c786ac09073267c271

2 years agoadd overload stubs for proxied classes
Vincent Fazio [Tue, 3 Jan 2023 17:39:13 +0000 (12:39 -0500)] 
add overload stubs for proxied classes

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

### Description
Closes #1146
Closes #1147

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

Overloaded functions would not have type stubs generated by the stub generator for proxied classes. Now they will.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

Closes: #1148
Pull-request: https://github.com/sqlalchemy/alembic/pull/1148
Pull-request-sha: ed3c28cc78e57314b7a4e533d77108efc6751949

Change-Id: I7c0ee9d333015174ee6ab754909748f745af2ff9

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