]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
5 years agoRestate installation and tutorial in terms of a virtualenv
Mike Bayer [Sat, 16 Nov 2019 00:13:11 +0000 (19:13 -0500)] 
Restate installation and tutorial in terms of a virtualenv

Since we have things like "cd myproject" in the documentation,
we are assuming some knowledge of how the project is set up.
As the vast majority of projects will have import statements
in their env.py, restate this documentation in terms of a
virtual environment where the local project is installed
in editable mode.

Change-Id: I6a11c5077c02a00145cb882b43d6c9a7c986e375
Fixes: #625
5 years agoVersion 1.3.2 placeholder
Mike Bayer [Wed, 13 Nov 2019 14:45:42 +0000 (09:45 -0500)] 
Version 1.3.2 placeholder

5 years ago- 1.3.1 rel_1_3_1
Mike Bayer [Wed, 13 Nov 2019 14:43:10 +0000 (09:43 -0500)] 
- 1.3.1

5 years agoSupport schemas for MSSQL drop server default + FK constraint
Mike Bayer [Tue, 12 Nov 2019 15:01:42 +0000 (10:01 -0500)] 
Support schemas for MSSQL drop server default + FK constraint

Fixed bug in MSSQL dialect where the drop constraint execution steps used
to remove server default or implicit foreign key constraint failed to take
into account the schema name of the target table.

Change-Id: Ia95b043ee6289efbb90d6f21392f4ce622748611
Fixes: #621
5 years agoVersion 1.3.1 placeholder
Mike Bayer [Thu, 31 Oct 2019 16:00:06 +0000 (12:00 -0400)] 
Version 1.3.1 placeholder

5 years ago- 1.3.0 rel_1_3_0
Mike Bayer [Thu, 31 Oct 2019 15:57:56 +0000 (11:57 -0400)] 
- 1.3.0

5 years agoMerge "Accommodate for SQLAlchemy 1.4 deferral of index/unique names"
mike bayer [Mon, 14 Oct 2019 19:26:09 +0000 (19:26 +0000)] 
Merge "Accommodate for SQLAlchemy 1.4 deferral of index/unique names"

5 years agoAccommodate for SQLAlchemy 1.4 deferral of index/unique names
Mike Bayer [Mon, 14 Oct 2019 04:07:55 +0000 (00:07 -0400)] 
Accommodate for SQLAlchemy 1.4 deferral of index/unique names

Some internal modifications have been made to how the names of indexes and
unique constraints work to make use of new functions added in SQLAlchemy
1.4, so that SQLAlchemy has more flexibility over how naming conventions
may be applied to these objects.

Change-Id: I7dc4f6c1c3cf13c503f2ab070afbf157f8f0e0d5

5 years agoMerge "Repair Variant argument order"
mike bayer [Mon, 14 Oct 2019 15:09:06 +0000 (15:09 +0000)] 
Merge "Repair Variant argument order"

5 years ago- repair next release version to be 1.3.0 matching __version__
Mike Bayer [Mon, 14 Oct 2019 14:18:01 +0000 (10:18 -0400)] 
- repair next release version to be 1.3.0 matching __version__

Change-Id: I8689b515698a400af2eee2253c60ead13a109386

5 years agoRepair Variant argument order
Mike Bayer [Mon, 14 Oct 2019 14:15:49 +0000 (10:15 -0400)] 
Repair Variant argument order

Fixed bug in new Variant autogenerate where the order of the arguments to
Variant were mistakenly reversed.

Change-Id: I15cd7d6a926a71005b8b7b9350279846d2886363
Fixes: #131
5 years agoupdates for README.unittests.rst
Mike Bayer [Mon, 14 Oct 2019 04:33:44 +0000 (00:33 -0400)] 
updates for README.unittests.rst

The "setup.py" script was still being referenced erroneously.
Also add a note that starting DB must be empty.

Change-Id: I8c4e70f67fa29fc3b388902b0afac50f9a34d10a
References: #610

5 years agoAllow ALEMBIC_CONFIG for config file location
Mike Bayer [Fri, 11 Oct 2019 15:04:24 +0000 (11:04 -0400)] 
Allow ALEMBIC_CONFIG for config file location

The ALEMBIC_CONFIG environment variable is now used as the
default alembic config file name for the -c option of the
command line runner, if present.

Bump revision to 1.3, as Alembic releases are infrequent,
start using a more semver-like approach to feature adds.

Change-Id: I2fdbd6a1ec2d173037e2e371f8851b0258e3efd5
Fixes: #608
5 years agoClarify sqlalchemy.url in tutorial.rst
Mike Bayer [Thu, 3 Oct 2019 15:43:38 +0000 (11:43 -0400)] 
Clarify sqlalchemy.url in tutorial.rst

Change-Id: Idf47390d132424a2a1998bbe73371d4cce9ce4f3
Fixes: #606
5 years agoVersion 1.2.2 placeholder
Mike Bayer [Tue, 24 Sep 2019 20:36:04 +0000 (16:36 -0400)] 
Version 1.2.2 placeholder

5 years ago- 1.2.1 rel_1_2_1
Mike Bayer [Tue, 24 Sep 2019 17:24:17 +0000 (13:24 -0400)] 
- 1.2.1

5 years agoRevert alembic.stamp "revisions" to "revision"
Thomas Bechtold [Tue, 24 Sep 2019 14:27:03 +0000 (10:27 -0400)] 
Revert alembic.stamp "revisions" to "revision"

Reverted the name change of the "revisions" argument to
:func:`.command.stamp` to "revision" as apparently applications are
calling upon this argument as a keyword name.  Pull request courtesy
Thomas Bechtold.  Special translations are also added to the command
line interface so that it is still known as "revisions" in the CLI.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #601
Closes: #602
Pull-request: https://github.com/sqlalchemy/alembic/pull/602
Pull-request-sha: 4126635e272f82ec53d630bb77c00cb6ff42cec9

Change-Id: I4312954bedc42bb4b76656a70c95b2b7280efae7

5 years agoRemove tests_require
Mike Bayer [Fri, 20 Sep 2019 18:45:36 +0000 (14:45 -0400)] 
Remove tests_require

Removed the "test requirements" from "setup.py test", as this command now
only emits a removal error in any case and these requirements are unused.

Change-Id: I53a798bdedad88d8f9708ed3fb6d8ed1aa49f526
Fixes: #592
5 years agoVersion 1.2.1 placeholder
Mike Bayer [Fri, 20 Sep 2019 14:35:55 +0000 (10:35 -0400)] 
Version 1.2.1 placeholder

5 years ago- 1.2.0 rel_1_2_0
Mike Bayer [Fri, 20 Sep 2019 14:29:00 +0000 (10:29 -0400)] 
- 1.2.0

5 years agoRefer to "pre-commit" not post-commit
Mike Bayer [Fri, 20 Sep 2019 14:27:57 +0000 (10:27 -0400)] 
Refer to "pre-commit" not post-commit

Change-Id: I6ca8a2cc9af3f67f8870a83049bbb241f6dc517c

5 years agoMerge "Render Variant types"
mike bayer [Fri, 20 Sep 2019 14:13:19 +0000 (14:13 +0000)] 
Merge "Render Variant types"

5 years agoAdd --package flag to write __init__.py files
Mike Bayer [Thu, 19 Sep 2019 20:59:27 +0000 (16:59 -0400)] 
Add --package flag to write __init__.py files

Added new flag ``--package`` to ``alembic init``.  For environments where
the Alembic migration files and such are within the package tree and
importable as modules, this flag can be specified which will add the
additional ``__init__.py`` files in the version location and the
environment location.

Change-Id: I4993d17936f2b8a9833a28f0788389b19ff4333e
Fixes: #463
5 years agoRender Variant types
Mike Bayer [Thu, 19 Sep 2019 21:40:06 +0000 (17:40 -0400)] 
Render Variant types

Added rendering for SQLAlchemy ``Variant`` datatypes, which render as the
base type plus one or more ``.with_variant()`` method calls.

Change-Id: Ic0eea1be911c2fb3e9802ec21ff99815a06602e3
Fixes: #131
5 years agoFix NormPathTest again....to not have my workstation paths in it :)
Mike Bayer [Thu, 19 Sep 2019 22:37:28 +0000 (18:37 -0400)] 
Fix NormPathTest again....to not have my workstation paths in it :)

Change-Id: I743f7ec9379a09a4ade4f4e4b03e586c0b06517b

5 years agoFix the NormPathTest to accommodate for multi-process staging directories
Mike Bayer [Thu, 19 Sep 2019 21:45:18 +0000 (17:45 -0400)] 
Fix the NormPathTest to accommodate for multi-process staging directories

Change-Id: Ie1659e51f889bca5d1fe30eb52bc1d5a7aef097c

5 years agoAdd test for normalization of script_dir, version_locations
Mike Bayer [Thu, 19 Sep 2019 20:19:25 +0000 (16:19 -0400)] 
Add test for normalization of script_dir, version_locations

Ensure ScriptDirectory normalizes paths.

Change-Id: I9feea25e03eb3037321341776502619be413080e
References: #590

5 years agoMerge "Add multiple revision support to stamp, support purge"
mike bayer [Thu, 19 Sep 2019 19:29:16 +0000 (19:29 +0000)] 
Merge "Add multiple revision support to stamp, support purge"

5 years agoMerge "Provide revision post-write hooks"
mike bayer [Thu, 19 Sep 2019 17:58:15 +0000 (17:58 +0000)] 
Merge "Provide revision post-write hooks"

5 years agoAdd multiple revision support to stamp, support purge
Mike Bayer [Thu, 19 Sep 2019 03:16:56 +0000 (23:16 -0400)] 
Add multiple revision support to stamp, support purge

Added new ``--purge`` flag to the ``alembic stamp`` command, which will
unconditionally erase the version table before stamping anything.  This is
useful for development where non-existent version identifiers might be left
within the table.  Additionally, ``alembic.stamp`` now supports a list of
revision identifiers, which are intended to allow setting up muliple heads
at once.  Overall handling of version identifiers within the
``alembic.stamp`` command has been improved with many new tests and
use cases added.

Fixes: #473
Change-Id: If06501b69afae9956df3d0bcd739063fb8042a02

5 years agoProvide revision post-write hooks
Mike Waites [Sun, 30 Dec 2018 16:09:27 +0000 (16:09 +0000)] 
Provide revision post-write hooks

Added "post write hooks" to revision generation.   The primary rationale is
to provide for code formatting tools to automatically format new revisions,
however any arbitrary script or Python function may be  invoked as a hook.
The hooks are enabled by providing a ``[post_write_hooks]`` section in the
alembic.ini file.   The provided hook is a command-line runner which
includes configuration examples for running Black or autopep8 on newly
generated revision scripts.

The documentation also illustrates a custom hook that converts Python
source spaces to tabs, as requested in #577.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #307
Fixes: #577
Change-Id: I9d2092d20ec23f62ed3b33d979c16b979a450b48

5 years agoMemoize elements in rewriter; use correct iteration
Mike Bayer [Thu, 19 Sep 2019 01:47:27 +0000 (21:47 -0400)] 
Memoize elements in rewriter; use correct iteration

Modified the logic of the :class:`.Rewriter` object such that it keeps a
memoization of which directives it has processed, so that it can ensure it
processes a particular directive only once, and additionally fixed
:class:`.Rewriter` so that it functions correctly for multiple-pass
autogenerate schemes, such as the one illustrated in the "multidb"
template.  By tracking which directives have been processed, a
multiple-pass scheme which calls upon the :class:`.Rewriter` multiple times
for the same structure as elements are added can work without running
duplicate operations on the same elements more than once.

Change-Id: I2cef13d51912f9d86ddd99b60e4d5b96dbf680ff
Fixes: #505
5 years ago- call the next release 1.2.0
Mike Bayer [Thu, 19 Sep 2019 00:15:52 +0000 (20:15 -0400)] 
- call the next release 1.2.0

Change-Id: I7d0b145afeaff8dfbdbe05d98486bdef3c0b46c2

5 years agoMerge "Support autogenerate for add_column kwargs"
mike bayer [Thu, 19 Sep 2019 00:13:42 +0000 (00:13 +0000)] 
Merge "Support autogenerate for add_column kwargs"

5 years agoMerge "Only allow partial revision match for > 3 characters"
mike bayer [Wed, 18 Sep 2019 01:01:03 +0000 (01:01 +0000)] 
Merge "Only allow partial revision match for > 3 characters"

5 years agoSupport autogenerate for add_column kwargs
Mike Bayer [Tue, 17 Sep 2019 23:00:50 +0000 (19:00 -0400)] 
Support autogenerate for add_column kwargs

Added autogenerate support for :class:`.Column` objects that have
dialect-specific ``**kwargs``, support first added in SQLAlchemy 1.3.
This includes SQLite "on conflict" as well as options used by some
third party dialects.

Change-Id: Iede4ee74e74181f2f2357c6a69c6f3fa0c985392
Fixes: #518
5 years agoMerge "Render a single "pass" only for UpgradeOps, DowngradeOps"
mike bayer [Tue, 17 Sep 2019 23:08:53 +0000 (23:08 +0000)] 
Merge "Render a single "pass" only for UpgradeOps, DowngradeOps"

5 years agoMerge "Use repr for table comment in create_table_comment / drop_table_comment"
mike bayer [Tue, 17 Sep 2019 23:04:20 +0000 (23:04 +0000)] 
Merge "Use repr for table comment in create_table_comment / drop_table_comment"

5 years agoOnly allow partial revision match for > 3 characters
Mike Bayer [Tue, 17 Sep 2019 22:25:41 +0000 (18:25 -0400)] 
Only allow partial revision match for > 3 characters

Made the command interface revision lookup behavior more strict in that an
Alembic revision number is only resolved based on a partial match rules if
it has at least four characters, to prevent simple typographical issues
from inadvertently  running migrations.

Change-Id: I9c4c87bb3fdb78d2dd264f37c99422df309c4e5c
Fixes: #534
5 years agoRender a single "pass" only for UpgradeOps, DowngradeOps
Mike Bayer [Tue, 17 Sep 2019 21:55:44 +0000 (17:55 -0400)] 
Render a single "pass" only for UpgradeOps, DowngradeOps

Improved the Python rendering of a series of migration operations such that
a single "pass" is rendered for a :class:`.UpgradeOps` or
:class:`.DowngradeOps` based on if no lines of Python code actually
rendered under the operation, rather than whether or not sub-directives
exist. Removed extra "pass" lines that would generate from the
:class:`.ModifyTableOps` directive so that these aren't duplicated under
operation rewriting scenarios.

Change-Id: Ia2547811565ac24ee0f56ce470f96ec567912de3
Fixes: #550
5 years agoTest PG autocommit only on postgresql
Mike Bayer [Tue, 17 Sep 2019 21:56:57 +0000 (17:56 -0400)] 
Test PG autocommit only on postgresql

Change-Id: Idee4a70b03a6c3939e77573b14658a67a07e6cea
Fixes: #123
5 years agoUse repr for table comment in create_table_comment / drop_table_comment
Mike Bayer [Tue, 17 Sep 2019 21:43:47 +0000 (17:43 -0400)] 
Use repr for table comment in create_table_comment / drop_table_comment

Fixed bug where rendering of comment text for table-level comments  within
:meth:`.Operations.create_table_comment` and
:meth:`.Operations.drop_table_comment` was not properly quote-escaped
within rendered Python code for autogenerate.

Fixes: #549
Change-Id: I0356cf0eb7c6c6dd3f765bd3ed6e81bccf62468c

5 years agoAdd autocommit_block
Mike Bayer [Tue, 17 Sep 2019 19:26:32 +0000 (15:26 -0400)] 
Add autocommit_block

Added new feature :meth:`.MigrationContext.autocommit_block`, a special
directive which will provide for a non-transactional block inside of a
migration script. The feature requres that: the database driver
(e.g. DBAPI) supports the AUTOCOMMIT isolation mode.  The directive
also necessarily needs to COMMIT the existing transaction in progress
in order to enter autocommit mode.

Change-Id: I107fe9772595db189b6ebeba6535ac8f275b3fe5
Fixes: #123
5 years agoMerge "fix CAST assertions for SQLA 1.4"
mike bayer [Fri, 30 Aug 2019 22:24:09 +0000 (22:24 +0000)] 
Merge "fix CAST assertions for SQLA 1.4"

5 years agofix CAST assertions for SQLA 1.4
Mike Bayer [Fri, 30 Aug 2019 21:21:09 +0000 (17:21 -0400)] 
fix CAST assertions for SQLA 1.4

SQLAlchemy 1.4 labels CAST expressions as the name of the column,
adjust for this.

Change-Id: I208427e9301de224bc108bd97bde4c203faf8196

5 years agoDrop python 3.4 support
Mike Bayer [Fri, 30 Aug 2019 17:51:44 +0000 (13:51 -0400)] 
Drop python 3.4 support

mysqlclient is no longer working in Python 3.4, and as pip is also
emitting warnings for dropped support, in order to maintain CI
we need to drop Python 3.4.  Also include 3.7, 3.8 in classifiers.

Change-Id: I6fb2514934b6133d2a484621a0d7003b424c66f4

5 years agoVersion 1.1.1 placeholder
Mike Bayer [Tue, 27 Aug 2019 00:03:56 +0000 (20:03 -0400)] 
Version 1.1.1 placeholder

5 years ago- 1.1.0 rel_1_1_0
Mike Bayer [Mon, 26 Aug 2019 23:47:13 +0000 (19:47 -0400)] 
- 1.1.0

5 years agofix typo
Mike Bayer [Mon, 26 Aug 2019 23:45:43 +0000 (19:45 -0400)] 
fix typo

Change-Id: I2f11c0a3132f9f89979a4a213b5e2cc69993ee4b

5 years agochange dist-html to use cp
Mike Bayer [Mon, 26 Aug 2019 23:41:58 +0000 (19:41 -0400)] 
change dist-html to use cp

for unknown reasons sphinx is suddenly having a problem with the
_static directory being moved a directory upwards, so change how
dist-html works to just build normally then move files

Change-Id: I3f1c7260975c91c90a8e1ffb16ecb481aa3a583f

5 years agoAdd clear_envs to these tests
Mike Bayer [Mon, 26 Aug 2019 23:23:10 +0000 (19:23 -0400)] 
Add clear_envs to these tests

Change-Id: If7dd0d6d1a19a3c112c1e13d7d744b1423a4ce28

5 years agoremove python setup.py test
Mike Bayer [Mon, 26 Aug 2019 22:46:29 +0000 (18:46 -0400)] 
remove python setup.py test

Removed the "python setup.py test" feature in favor of a straight run of
"tox".   Per Pypa / pytest developers, "setup.py" commands are in general
headed towards deprecation in favor of tox.  The tox.ini script has been
updated such that running "tox" with no arguments will perform a single run
of the test suite against the default installed Python interpreter.

.. seealso::

    https://github.com/pypa/setuptools/issues/1684

    https://github.com/pytest-dev/pytest/issues/5534

Change-Id: Ib92ef8d20ad0e6f1e1b9d25051b788788cc69b02
Fixes: #592
5 years agoRecipe for ignoring connection tables that aren't in the metadata
Mike Bayer [Sun, 25 Aug 2019 22:49:19 +0000 (18:49 -0400)] 
Recipe for ignoring connection tables that aren't in the metadata

Change-Id: Ic4e4feb8fa1407eaa69166d06043afaba0824a50

5 years agoInclude existing_comment in MySQLChangeColumn
Mike Bayer [Sat, 24 Aug 2019 02:23:00 +0000 (22:23 -0400)] 
Include existing_comment in MySQLChangeColumn

Fixed issue where emitting a change of column name for MySQL did not
preserve the column comment, even if it were specified as existing_comment.

Change-Id: I93a63e5b7c4b629e42088242a9be345de94aa6ea
Fixes: #594
5 years agoFix typo 593/head
Ashwin Ramaswami [Tue, 20 Aug 2019 16:19:02 +0000 (09:19 -0700)] 
Fix typo

6 years agoUse new create_mock_engine
Mike Bayer [Fri, 2 Aug 2019 18:04:58 +0000 (14:04 -0400)] 
Use new create_mock_engine

strategy="mock" is deprecated in 1.4

Change-Id: Ie96b7575c6ef9ca9e22874fb1bf1c19518bde3da

6 years agoUse SQLAlchemy's testing framework fully
Mike Bayer [Sun, 21 Jul 2019 18:12:12 +0000 (14:12 -0400)] 
Use SQLAlchemy's testing framework fully

w/ 1.1 as the minimum version we should be able
to remove the majority of the testing suite code

Change-Id: I04c4ab45e2ce47f20613d6111895c6230b946f76

6 years agoMerge "Bump to Alembic 1.1, bump requirements"
mike bayer [Sun, 21 Jul 2019 18:55:21 +0000 (18:55 +0000)] 
Merge "Bump to Alembic 1.1, bump requirements"

6 years agoBump to Alembic 1.1, bump requirements
Mike Bayer [Sun, 21 Jul 2019 16:56:20 +0000 (12:56 -0400)] 
Bump to Alembic 1.1, bump requirements

Alembic 1.1 bumps the minimum version of SQLAlchemy to 1.1.   As was the
case before, Python requirements remain at Python 2.7, or in the 3.x series
Python 3.4.

Change-Id: I68074fb4b59c96c4a596396a69aa143c65d048b5

6 years ago- Correct version info for dialect_opts feature
Mike Bayer [Sun, 21 Jul 2019 16:57:29 +0000 (12:57 -0400)] 
- Correct version info for dialect_opts feature

Change-Id: Ifb6c9ff84f6268994a0ecb628b85630d5181c32d

6 years agoAdd dialect_options to environment; set paramstyle=named for offline
Mike Bayer [Sat, 20 Jul 2019 16:54:37 +0000 (12:54 -0400)] 
Add dialect_options to environment; set paramstyle=named for offline

Fixed bug where the double-percent logic applied to some dialects such as
psycopg2 would be rendered in ``--sql`` mode, by allowing dialect options
to be passed through to the dialect used to generate SQL and then providing
``paramstyle="named"`` so that percent signs need not be doubled.   For
users having this issue, existing env.py scripts need to add
``dialect_opts={"paramstyle": "named"}`` to their offline
context.configure().  See the ``alembic/templates/generic/env.py`` template
for an example.

Change-Id: Ia6a495704b029eaff43fb3b6df602ca667002b7a
Fixes: #562
6 years agoAllow init into existing but empty directory
Aviskar KC [Thu, 4 Jul 2019 18:31:03 +0000 (14:31 -0400)] 
Allow init into existing but empty directory

The "alembic init" command will now proceed if the target directory exists
as long as it's still empty.  Previously, it would not proceed if the
directory existed. The new behavior is modeled from what git does, to
accommodate for container or other deployments where an Alembic target
directory may need to be already mounted instead of being created with
alembic init.  Pull request courtesy Aviskar KC.

Fixes: #571
Closes: #574
Pull-request: https://github.com/sqlalchemy/alembic/pull/574
Pull-request-sha: ab7b8f342a89c752460d171cd50d1f958c7d59c9

Change-Id: I6b0cff9a7e940d9d878aa339891bda33744a2a4c

6 years agoFix imp warning
Mike Bayer [Thu, 18 Jul 2019 15:59:59 +0000 (11:59 -0400)] 
Fix imp warning

Fixed use of the deprecated "imp" module, which is used to detect  pep3147
availability as well as to locate .pyc files, which started  emitting
deprecation warnings during the test suite.   The warnings were not being
emitted earlier during the test suite, the change is possibly due to
changes in py.test itself but this is not clear. The check for pep3147 is
set to True for any Python version 3.5 or greater now and importlib is used
when available.  Note that some dependencies such as distutils may still be
emitting this warning. Tests are adjusted to accommodate for dependencies
that emit the warning as well.

Pin pycodestyle - PyCQA/pydocstyle#375

Change-Id: Id7795d581f3ac2172960d31e33ee46b95117e5c4

6 years agoAdd cookbook recipe for non-ascii migration files under python 2
Mike Bayer [Wed, 3 Jul 2019 17:38:48 +0000 (13:38 -0400)] 
Add cookbook recipe for non-ascii migration files under python 2

Unicode-related directives can be added to ``script.py.mako``
and as this issue has never been reported for many years as well
as that Python 2 is deprecated, resolve this as a cookbook recipe
that illustrates where unicode related directives and conversions
need to occur under Python 2.

Change-Id: Ib8b5446c0ef26db8a99f2ca26da000e9134102e9
Fixes: #584
6 years agoDocument compare_type limitations
Mike Bayer [Wed, 3 Jul 2019 14:14:53 +0000 (10:14 -0400)] 
Document compare_type limitations

Change-Id: Ie02575598d052533c85b4c680c29605cb8560521
References: #583

6 years agoReplaceableObject: change `self.view` to `self.target`
William Weiskopf [Fri, 28 Jun 2019 16:47:53 +0000 (12:47 -0400)] 
ReplaceableObject: change `self.view` to `self.target`

6 years agoVersion 1.0.12 placeholder
Mike Bayer [Tue, 25 Jun 2019 21:39:41 +0000 (17:39 -0400)] 
Version 1.0.12 placeholder

6 years ago- 1.0.11 rel_1_0_11
Mike Bayer [Tue, 25 Jun 2019 21:36:29 +0000 (17:36 -0400)] 
- 1.0.11

6 years agoMerge "Ensure SQLite default expressions are parenthesized"
mike bayer [Tue, 25 Jun 2019 21:35:03 +0000 (21:35 +0000)] 
Merge "Ensure SQLite default expressions are parenthesized"

6 years agoEnsure SQLite default expressions are parenthesized
Mike Bayer [Tue, 25 Jun 2019 15:40:56 +0000 (11:40 -0400)] 
Ensure SQLite default expressions are parenthesized

- SQLite server default reflection will ensure parenthesis are surrounding a
column default expression that is detected as being a non-constant
expression, such as a ``datetime()`` default, to accommodate for the
requirement that SQL expressions have to be parenthesized when being sent
as DDL.  Parenthesis are not added to constant expressions to allow for
maximum cross-compatibility with other dialects and existing test suites
(such as Alembic's), which necessarily entails scanning the expression to
eliminate for constant numeric and string values. The logic is added to the
two "reflection->DDL round trip" paths which are currently autogenerate and
batch migration.  Within autogenerate, the logic is on the rendering side,
whereas in batch the logic is installed as a column reflection hook.

- Improved SQLite server default comparison to accommodate for a ``text()``
construct that added parenthesis directly vs. a construct that relied
upon the SQLAlchemy SQLite dialect to render the parenthesis, as well
as improved support for various forms of constant expressions such as
values that are quoted vs. non-quoted.

- Fixed bug where the "literal_binds" flag was not being set when
autogenerate would create a server default value, meaning server default
comparisons would fail for functions that contained literal values.

Fixes: #579
Change-Id: I78b87573b8ecd15cb4ced08f054902f574e3956c

6 years agofix "sqlalchemy" typo
Mike Bayer [Tue, 25 Jun 2019 19:33:41 +0000 (15:33 -0400)] 
fix "sqlalchemy" typo

Change-Id: I0c98747dfebabb2a9593a270ab599bd7575e90fd

6 years agoReport warnings from caller's file/line number, not utils.py
Ash Berlin-Taylor [Fri, 21 Jun 2019 12:53:11 +0000 (08:53 -0400)] 
Report warnings from caller's file/line number, not utils.py

Warnings emitted by Alembic now include a default stack level of 2, and in
some cases it's set to 3, in order to help warnings indicate more closely
where they are originating from.  Pull request courtesy Ash Berlin-Taylor.

Closes: #578
Pull-request: https://github.com/sqlalchemy/alembic/pull/578
Pull-request-sha: 49d2922dc61bfc6da42a5f45b53f04032970daeb

Change-Id: I31e19cacd63a4a7ff0557d9e7f52d348f63744d6

6 years agoAdd "usecase" changelog tag
Mike Bayer [Mon, 3 Jun 2019 16:52:12 +0000 (12:52 -0400)] 
Add "usecase" changelog tag

"usecase" indicates the library now supports something a user
was trying to do.  It's not quite a "feature" since it's something
that seems like it should have worked, it's not a "bug" because
no mistake was made, it's just something that wasn't considered before.
The advantage of "usecase" is that it inherently suggests a different
style of prioritization vs. something that is preventing the library
from working as designed.

This change also adds docs/build/conf.py under the pep8 formatting
test coverage, and additionally moves release / release_date to
be present within; the release scripts will be altered to include
this.

Change-Id: Iea071a320e7a3672b35a41b13d5a74c0da5f9074

6 years agoUse vendored getargspec()
Mike Bayer [Wed, 29 May 2019 21:32:57 +0000 (17:32 -0400)] 
Use vendored getargspec()

Replaced the Python compatbility routines for ``getargspec()`` with a fully
vendored version based on ``getfullargspec()`` from Python 3.3.
Originally, Python was emitting deprecation warnings for this function in
Python 3.8 alphas.  While this change was reverted, it was observed that
Python 3 implementations for ``getfullargspec()`` are an order of magnitude
slower as of the 3.4 series where it was rewritten against ``Signature``.
While Python plans to improve upon this situation, SQLAlchemy projects for
now are using a simple replacement to avoid any future issues.

Change-Id: If5f3e2f6cc0df8d89e6c3035e024df3319964bf9
Fixes: #563
6 years agoFix rst flake8 issues that have come online w/ latest update
Mike Bayer [Wed, 29 May 2019 22:49:38 +0000 (18:49 -0400)] 
Fix rst flake8 issues that have come online w/ latest update
of flake8-rst-docstrings

Change-Id: I19288e69128648045d826045343fa5c1c8426ec2

6 years ago- update LICENSE to exact MIT text
Mike Bayer [Tue, 28 May 2019 16:44:28 +0000 (12:44 -0400)] 
- update LICENSE to exact MIT text

Change-Id: Ie49666cb11eb00a40d805f4f80a3d83490b70964

6 years ago- add OSI classifier for license
Mike Bayer [Tue, 28 May 2019 13:46:05 +0000 (09:46 -0400)] 
- add OSI classifier for license

Change-Id: I6c224a8b4061a02cb31d07161bb67632a6b3d1e3

6 years agoAdd issue tracker metadata
Mike Bayer [Mon, 27 May 2019 23:03:55 +0000 (19:03 -0400)] 
Add issue tracker metadata

Change-Id: I850c35cef1b4baed7b30510429d1785d0bf5673a

6 years ago- add sqla 1.3 part 2
Mike Bayer [Thu, 23 May 2019 22:50:26 +0000 (18:50 -0400)] 
- add sqla 1.3 part 2

Change-Id: Id970fe3b2fc64459737e5d0a77fdd8304cc6a7ae

6 years ago- add sqla 1.3
Mike Bayer [Thu, 23 May 2019 20:55:48 +0000 (16:55 -0400)] 
- add sqla 1.3

Change-Id: Id568effcce6a1706f37787baa8afcfadf221abc7

6 years agoUse CHANGE COLUMN for MySQL / MariaDB DateTime server default change
Mike Bayer [Mon, 20 May 2019 17:29:55 +0000 (13:29 -0400)] 
Use CHANGE COLUMN for MySQL / MariaDB DateTime server default change

Fixed issue where MySQL databases need to use CHANGE COLUMN when altering a
server default of CURRENT_TIMESTAMP, NOW() and probably other functions
that are only usable with DATETIME/TIMESTAMP columns.  While MariaDB
supports both CHANGE and ALTER COLUMN in this case, MySQL databases only
support CHANGE.  So the new logic is that if the server default change is
against a DateTime-oriented column, the CHANGE format is used
unconditionally, as in the vast majority of cases the server default is to
be CURRENT_TIMESTAMP which may also be potentially bundled with an "ON
UPDATE CURRENT_TIMESTAMP" directive, which SQLAlchemy does not currently
support as a distinct field.

Change-Id: I67cf75c2fba640e737f5ffd79a8ad5636b9eeccc
Fixes: #564
6 years agoCreate alter column backend test fixture
Mike Bayer [Sun, 19 May 2019 22:33:39 +0000 (18:33 -0400)] 
Create alter column backend test fixture

For more expedient confirmation of op functionality,
start building generalized backend fixtures for ops.

Add basic round trip tests for alter column, obviously
disabled on SQLite.   Ensure this passes for the full
span of MySQL, Oracle, SQL Server on CI (PG is fine).
Next we can begin adding tests for all the MySQL issues
that are coming up such as #564, where regular ALTER COLUMN
is not consistently implemented based on datatypes etc.

Change-Id: I00ef174aa791ce7baeb764c5915591cd095deae0

6 years agoAdd .pre-commit-config.yaml
Mike Bayer [Sat, 18 May 2019 14:50:40 +0000 (10:50 -0400)] 
Add .pre-commit-config.yaml

See https://pre-commit.com/ for documentation on how to use
this file.

SQLAlchemy and related projects make use of Black and zimports
for code formatting, this hook allows for automated pre-commit
runs.

Change-Id: I4bbb49747e9f7fb52251dc61ecda98361cd036fd

6 years agoAdd database freshness check cookbook recipe
m-aciek [Mon, 13 May 2019 21:12:10 +0000 (23:12 +0200)] 
Add database freshness check cookbook recipe

Change-Id: Iefeaadefafa286dbdb50d3034549284ee31f6623
Fixes: #559
Closes: #560
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
(cherry picked from commit 81a595598f352b4f93cdf849df7d96ab3b1fc8af)

6 years agoUpdate to latest README.unittests.rst
Mike Bayer [Mon, 6 May 2019 14:11:04 +0000 (10:11 -0400)] 
Update to latest README.unittests.rst

Also note run_tests.py is deprecated.

Change-Id: Ie82dd3133b487f61b32e005d6f2b8941cddfcce3
Fixes: #557
6 years agoMerge "Further updates to CHECK logic"
mike bayer [Mon, 6 May 2019 02:40:14 +0000 (02:40 +0000)] 
Merge "Further updates to CHECK logic"

6 years agoFurther updates to CHECK logic
Mike Bayer [Sat, 4 May 2019 17:25:25 +0000 (13:25 -0400)] 
Further updates to CHECK logic

Change-Id: I5b0905df8d438eaa2a9665203f3d98a0db9c31f4

6 years agoEmit DROP CHECK for MySQL, DROP CONSTRAINT for MariaDB
Mike Bayer [Tue, 30 Apr 2019 14:23:20 +0000 (10:23 -0400)] 
Emit DROP CHECK for MySQL, DROP CONSTRAINT for MariaDB

Added support for MySQL "DROP CHECK", which is added as of MySQL 8.0.16,
separate from MariaDB's "DROP CONSTRAINT" for CHECK constraints.  The MySQL
Alembic implementation now checks for "MariaDB" in server_version_info to
decide which one to use.

Change-Id: I22d1eb084570769ec11b654bc01af3a0938d9a7c
Fixes: #554
6 years agoTune "rename boolean column w CHECK constraint" test for MySQL 8, mariadb10.2
Mike Bayer [Thu, 2 May 2019 15:41:48 +0000 (09:41 -0600)] 
Tune "rename boolean column w CHECK constraint" test for MySQL 8, mariadb10.2

Change-Id: Idb5292f3976b9632069145ff0a7df948a945d7d8
Fixes: #556
6 years agoVersion 1.0.11 placeholder
Mike Bayer [Sun, 28 Apr 2019 19:00:36 +0000 (15:00 -0400)] 
Version 1.0.11 placeholder

6 years ago- 1.0.10 rel_1_0_10
Mike Bayer [Sun, 28 Apr 2019 18:55:16 +0000 (14:55 -0400)] 
- 1.0.10

6 years ago-fix typo
Mike Bayer [Sun, 28 Apr 2019 18:51:34 +0000 (14:51 -0400)] 
-fix typo

Change-Id: I31641577b8324a7ed713356a6ae597d19e1c61e4

6 years agoMerge "Check for rendered integer default is None on MySQL"
mike bayer [Sun, 28 Apr 2019 03:14:02 +0000 (03:14 +0000)] 
Merge "Check for rendered integer default is None on MySQL"

6 years agoCheck for rendered integer default is None on MySQL
Mike Bayer [Sat, 27 Apr 2019 00:22:21 +0000 (20:22 -0400)] 
Check for rendered integer default is None on MySQL

Fixed bug when using the
:paramref:`.EnvironmentContext.configure.compare_server_default` flag set
to ``True``where a server default that is introduced in the table metadata
on an ``Integer`` column, where there is no existing server default in the
database, would raise a ``TypeError``.

Change-Id: Ia2954cc113b47687d1cbf8244c77742326a50c86
Fixes: #553
6 years agoMerge "Raise for non-string revision identifier"
mike bayer [Sun, 28 Apr 2019 03:12:41 +0000 (03:12 +0000)] 
Merge "Raise for non-string revision identifier"

6 years agoRaise for non-string revision identifier
Mike Bayer [Wed, 24 Apr 2019 18:46:03 +0000 (13:46 -0500)] 
Raise for non-string revision identifier

Added an assertion in :meth:`.RevisionMap.get_revisions` and other methods
which ensures revision numbers are passed as strings or collections of
strings.   Driver issues particularly on MySQL may inadvertently be passing
bytes here which leads to failures later on.

Change-Id: Id80c958f0a082fed26cac2cf838cb7507b8d814c
Fixes: #551
6 years agoMerge "Use first line of command docstring for help text."
mike bayer [Tue, 23 Apr 2019 22:36:48 +0000 (22:36 +0000)] 
Merge "Use first line of command docstring for help text."

6 years agoUse first line of command docstring for help text.
Mike Bayer [Tue, 23 Apr 2019 17:21:09 +0000 (12:21 -0500)] 
Use first line of command docstring for help text.

Fixed bug introduced in release 1.0.9 where the helptext for commands
inadvertently got expanded to include function docstrings from the
command.py module.  The logic has been adjusted to only refer to the first
line of each docstring as was the original intent.

Change-Id: I88d7b31b6b54fd065511d969849aef3977eaf6a0
Fixes: #552
6 years agoVersion 1.0.10 placeholder
Mike Bayer [Mon, 15 Apr 2019 15:47:18 +0000 (11:47 -0400)] 
Version 1.0.10 placeholder

6 years ago- 1.0.9 rel_1_0_9
Mike Bayer [Mon, 15 Apr 2019 15:38:59 +0000 (11:38 -0400)] 
- 1.0.9