]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/log
thirdparty/sqlalchemy/alembic.git
7 years agoAdd cookbook recipe for don't render DROP INDEX
Mike Bayer [Tue, 28 Nov 2017 17:10:39 +0000 (12:10 -0500)] 
Add cookbook recipe for don't render DROP INDEX

Filters out DropIndexOp when there is a corresponding
DropTableOp.

Change-Id: I7baadf6e5b9f669c875aeeaccefb19cb5e105953
Fixes: #467
7 years agoMerge pull request #42 from russellballestrini/patch-1
mike bayer [Tue, 31 Oct 2017 15:31:20 +0000 (11:31 -0400)] 
Merge pull request #42 from russellballestrini/patch-1

Update naming.rst

7 years agotrack 0.9.7 notes
Mike Bayer [Fri, 27 Oct 2017 18:16:46 +0000 (14:16 -0400)] 
track 0.9.7 notes

Change-Id: Idbf1383da9a575f29aa37ab02fc242f13c91332e

7 years agoResolve Postgresql implicit indexes via duplicates_constraint
Mike Bayer [Wed, 25 Oct 2017 19:24:29 +0000 (15:24 -0400)] 
Resolve Postgresql implicit indexes via duplicates_constraint

Fixed bug where autogenerate would produce a DROP statement for the index
implicitly created by a Postgresql EXCLUDE constraint, rather than skipping
it as is the case for indexes implicitly generated by unique constraints.
Makes use of SQLAlchemy 1.0.x's improved "duplicates index" metadata and
requires at least SQLAlchemy version 1.0.x to function correctly.

Change-Id: I7362c8045f69553c6090dd3cb236569b0c9b1e67
Fixes: #461
7 years agoUpdate naming.rst
Russell Ballestrini [Tue, 24 Oct 2017 04:51:54 +0000 (00:51 -0400)] 
Update naming.rst

Consistent quotes. I'm going to make the same PR to the alembic docs.

I made similar change here: https://github.com/Pylons/pyramid-cookiecutter-alchemy/pull/23

7 years ago- 0.9.6 rel_0_9_6
Mike Bayer [Fri, 13 Oct 2017 15:17:07 +0000 (11:17 -0400)] 
- 0.9.6

7 years agoClean up all Python 3.6 warnings
Mike Bayer [Wed, 11 Oct 2017 21:17:19 +0000 (17:17 -0400)] 
Clean up all Python 3.6 warnings

Fixed a few Python3.6 deprecation warnings by replacing ``StopIteration``
with ``return``, as well as using ``getfullargspec()`` instead of
``getargspec()`` under Python 3.

Additionally fixed docstrings with backslashes needing r'', filehandles
not explicitly closed, accommodate for .pyc files not necessarily present.

Change-Id: Id9791c5fa8b4b1f3e4e36f237a8a8ebcef4aaaba
Fixes: #458
7 years agoMerge "Append table name to batch temp name"
mike bayer [Wed, 11 Oct 2017 20:53:25 +0000 (16:53 -0400)] 
Merge "Append table name to batch temp name"

7 years agoClean up _fk_colspec() for link_to_name, no column found
Mike Bayer [Wed, 11 Oct 2017 13:53:22 +0000 (09:53 -0400)] 
Clean up _fk_colspec() for link_to_name, no column found

A :class:`.ForeignKeyConstraint` can now render correctly if the
``link_to_name`` flag is set, as it will not attempt to resolve the name
from a "key" in this case.  Additionally, the constraint will render
as-is even if the remote column name isn't present on the referenced
remote table.

Change-Id: Ic030fbc106973231b6877c1acfb5349e515335a8
Fixes: #456
7 years agoAppend table name to batch temp name
Mike Bayer [Wed, 11 Oct 2017 14:08:19 +0000 (10:08 -0400)] 
Append table name to batch temp name

The name of the temporary table in batch mode is now generated
off of the original table name itself, to avoid conflicts for the
unusual case of multiple batch operations running against the same
database schema at the same time.

Change-Id: Idbeabf9558887d3f5525e7045d5de33bab6805a5
Fixes: #457
7 years ago- keep tuning this mariadb check constraint limitation
Mike Bayer [Sun, 8 Oct 2017 22:53:08 +0000 (18:53 -0400)] 
- keep tuning this mariadb check constraint limitation

Change-Id: I738fbd48a49e78e7103caad5872d592c0691e694

7 years ago- more mariadb 10.2 tests that won't work
Mike Bayer [Fri, 6 Oct 2017 20:31:09 +0000 (16:31 -0400)] 
- more mariadb 10.2 tests that won't work

Change-Id: I7484c653e5f90adb0b25cb74263c99d7bfec5be0

7 years ago- still attempt to exclude mariadb 10.2 from this test for older
Mike Bayer [Fri, 6 Oct 2017 19:03:21 +0000 (15:03 -0400)] 
- still attempt to exclude mariadb 10.2 from this test for older
SQLAlchemy versions

Change-Id: I38aaa14cae326206f4d2c0f22150336957187de7

7 years agoAccommodate for mariadb 10.2 function reflection style
Mike Bayer [Wed, 4 Oct 2017 20:01:33 +0000 (16:01 -0400)] 
Accommodate for mariadb 10.2 function reflection style

Fixed bug where server default comparison of CURRENT_TIMESTAMP would fail
on MariaDB 10.2 due to a change in how the function is
represented by the database during reflection.

Also implement mariadb 10.2 checks from SQLAlchemy to skip
other CHECK contraint related tests that can't pass.

Change-Id: Id77b527d3215d06e2f44a6cddeb77583e5b39101
Fixes: #455
7 years agoFix flake8 E265 violation in multidb env.py template
Peter Marsh [Sun, 24 Sep 2017 15:35:20 +0000 (16:35 +0100)] 
Fix flake8 E265 violation in multidb env.py template

flake8 detected the following violation in env.py for multidb
projects:

    multidb/env.py:34:1: E265 block comment should start with '# '
    #}
    ^

This fixes the violation in the template, so fresh multidb projects
will no longer have this violation.

7 years agoMerge "Use bitbucket for SQLA branch"
mike bayer [Thu, 21 Sep 2017 15:57:14 +0000 (11:57 -0400)] 
Merge "Use bitbucket for SQLA branch"

7 years agoUse bitbucket for SQLA branch
Mike Bayer [Thu, 21 Sep 2017 15:03:23 +0000 (11:03 -0400)] 
Use bitbucket for SQLA branch

git.sqlalchemy.org is retired for now, consume from bitbucket

Change-Id: I1501528d6856985965feede1f2a05e1488c50382

7 years agoAdd + to illegal revision characters list
Mike Bayer [Sat, 16 Sep 2017 00:25:43 +0000 (20:25 -0400)] 
Add + to illegal revision characters list

An addition to :ticket:`441` fixed in 0.9.5, we forgot to also filter
for the ``+`` sign in migration names which also breaks due to the relative
migrations feature.

Change-Id: I94d3882e84ba13e7569b47230dc9422a8ac6408c
Fixes: #445
7 years agoSupport pep3149, latest import mechanics, fully
Mike Bayer [Thu, 7 Sep 2017 21:43:00 +0000 (17:43 -0400)] 
Support pep3149, latest import mechanics, fully

Reworked "sourceless" system to be fully capable of handling any
combination of: Python2/3x, pep3149 or not, PYTHONOPTIMIZE or not,
for locating and loading both env.py files as well as versioning files.
This includes: locating files inside of ``__pycache__`` as well as listing
out version files that might be only in ``versions/__pycache__``, deduplicating
version files that may be in ``versions/__pycache__`` and ``versions/``
at the same time, correctly looking for .pyc or .pyo files based on
if pep488 is present or not. The latest Python3x deprecation warnings
involving importlib are also corrected.

Change-Id: I2495e793c81846d3f05620dbececb18973dd8a8f
Fixes: #449
7 years ago- fix py26 syntax error
Mike Bayer [Fri, 8 Sep 2017 15:56:00 +0000 (11:56 -0400)] 
- fix py26 syntax error

Change-Id: I897525e0f1ea0ec2cbaec293bac51dc057dddf87

7 years agoUse env in history when revision_history=true
Mike Bayer [Wed, 6 Sep 2017 14:20:39 +0000 (10:20 -0400)] 
Use env in history when revision_history=true

The ``alembic history`` command will now make use of the revision
environment ``env.py`` unconditionally if the ``revision_environment``
configuration flag is set to True.  Previously, the environment would
only be invoked if the history specification were against a database-stored
revision token.

Change-Id: I2f9dc2554c8a4523f93248859587e8e276fe4d4a
Fixes: #447
7 years agoset native boolean to false on the dialect for the schematype tests
Mike Bayer [Thu, 31 Aug 2017 02:32:50 +0000 (22:32 -0400)] 
set native boolean to false on the dialect for the schematype tests

mssql in 1.2 now does native boolean
by default which is not what this test looks for

Change-Id: I26a21195efaad3bcce6cc09fd98a6d3ce6e9a029

7 years agoDon't compare scale if Numeric has no precision
pg3-ivan [Fri, 25 Aug 2017 14:02:31 +0000 (10:02 -0400)] 
Don't compare scale if Numeric has no precision

Fixed bug where comparison of ``Numeric`` types would produce
a difference if the Python-side ``Numeric`` inadvertently specified
a non-None "scale" with a "precision" of None, even though this ``Numeric``
type will pass over the "scale" argument when rendering. Pull request
courtesy Ivan Mmelnychuk.

Change-Id: I0a676e01579fdf6802bf53ea7f9238003da98847
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/70

7 years ago- merge latest CI options from SQLAlchemy
Mike Bayer [Tue, 22 Aug 2017 17:31:29 +0000 (13:31 -0400)] 
- merge latest CI options from SQLAlchemy

Change-Id: Ia84a7f0779260874137e8d1b3a14b4f6e4778752

7 years ago- santitize brackets / periods from classnames for junitxml
Mike Bayer [Mon, 21 Aug 2017 21:16:47 +0000 (17:16 -0400)] 
- santitize brackets / periods from classnames for junitxml

Change-Id: I1071bd70fd4166937b07536725f0900cba03d86b

7 years agoEnable multi-backend / driver in tests
Mike Bayer [Mon, 21 Aug 2017 20:43:05 +0000 (16:43 -0400)] 
Enable multi-backend / driver in tests

Turn on __backend__ everywhere we can.  Also try removing two worker
limitaiton on oracle.

Change-Id: Ib16ebbd9f9ae35893a74cbf823444d2cc4c731f0

7 years ago- dont use sitepackages
Mike Bayer [Mon, 21 Aug 2017 16:25:26 +0000 (12:25 -0400)] 
- dont use sitepackages
- only need usedevelop for coverage case

Change-Id: Icba6d9f500e206c39a7d2d0ed77e82ad9ad3784d

7 years ago- since non-oracle urls are written, filter on just
Mike Bayer [Mon, 21 Aug 2017 16:06:44 +0000 (12:06 -0400)] 
- since non-oracle urls are written, filter on just
the oracle urls for the DB dropper

Change-Id: I1835c1b312a21a48657d89a84ed1041d6d5ebd73

7 years ago- merge new CI support from SQLAlchemy including
Mike Bayer [Mon, 21 Aug 2017 15:20:13 +0000 (11:20 -0400)] 
- merge new CI support from SQLAlchemy including
multi-backend per dialect and oracle support

7 years ago- support pymysql for tests
Mike Bayer [Sat, 19 Aug 2017 22:42:20 +0000 (18:42 -0400)] 
- support pymysql for tests

Change-Id: Ibb13314a5a55733f7bd56a4fc9ac43bc04c97ac7

7 years ago- add new TOX_ control variables for CI
Mike Bayer [Sat, 19 Aug 2017 21:20:37 +0000 (17:20 -0400)] 
- add new TOX_ control variables for CI

Change-Id: Id6a417911623ea810af605eb0f73851184cf7dbe

7 years agoAdd generic per-type rendering, implement ARRAY
Mike Bayer [Wed, 16 Aug 2017 14:26:16 +0000 (10:26 -0400)] 
Add generic per-type rendering, implement ARRAY

Fixed bug expanding upon the fix for
:ticket:`85` which adds the correct module import to the
"inner" type for an ``ARRAY`` type, the fix now accommodates for the
generic ``sqlalchemy.types.ARRAY`` type added in SQLAlchemy 1.1,
rendering the inner type correctly regardless of whether or not the
Postgresql dialect is present.

Change-Id: I98ffbf95a88dc815404a2d1020b0e3e56742ca8c
Fixes: #442
7 years ago- add 0.9.6 changelog placeholder
Mike Bayer [Wed, 16 Aug 2017 13:41:28 +0000 (09:41 -0400)] 
- add 0.9.6 changelog placeholder

Change-Id: Icb63e42c369d1e61582b767c650d44f55518892e

7 years agounblock pytest-xdist, add sqla master
Mike Bayer [Wed, 9 Aug 2017 18:56:33 +0000 (14:56 -0400)] 
unblock pytest-xdist, add sqla master

Change-Id: I8e150e5e4de50c9819c97ab2b3960c1eb9c0ebd1

7 years ago- 0.9.5 rel_0_9_5
Mike Bayer [Wed, 9 Aug 2017 14:11:07 +0000 (10:11 -0400)] 
- 0.9.5

7 years agofix using tzdata-compliant time zone names
Nils Philippsen [Wed, 9 Aug 2017 13:34:45 +0000 (09:34 -0400)] 
fix using tzdata-compliant time zone names

Previously, time zone names were capitalized indiscriminately, making it
impossible to use names containing lowercase characters with Alembic.

https://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones

Change-Id: I89288447f91e98dc106d82a1ee233f2f3de30c78
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/69

8 years agoMerge "Raise if manual revision id contains dashes or at signs"
mike bayer [Fri, 4 Aug 2017 18:33:34 +0000 (14:33 -0400)] 
Merge "Raise if manual revision id contains dashes or at signs"

8 years agoRaise if manual revision id contains dashes or at signs
Mike Bayer [Fri, 4 Aug 2017 17:28:56 +0000 (13:28 -0400)] 
Raise if manual revision id contains dashes or at signs

A :class:`.CommandError` is raised if the "--rev-id" passed to the
:func:`.revision` command contains dashes or at-signs, as this interferes
with the command notation used to locate revisions.

Change-Id: I60a794a5c80bf47b149998b8c5cb04ecbfd05bfa
Fixes: #441
8 years agoAdd support for kw to DROP INDEX, test postgresql_concurrently
Mike Bayer [Thu, 3 Aug 2017 19:31:17 +0000 (15:31 -0400)] 
Add support for kw to DROP INDEX, test postgresql_concurrently

Change-Id: I89c98401d3e1f1252041b622e045c6dc85fa59a1
Fixes: #424
8 years agoPin to pytest<=3.0.7 pytest-xdist<=1.16.0
Mike Bayer [Fri, 4 Aug 2017 14:01:27 +0000 (10:01 -0400)] 
Pin to pytest<=3.0.7 pytest-xdist<=1.16.0

Until https://github.com/pytest-dev/pytest-xdist/issues/196 is fixed

Change-Id: I35004dd8bea240b7d91d72f2ea86cb732fe861e0

8 years ago- 0.9.5. setup
Mike Bayer [Thu, 3 Aug 2017 19:24:28 +0000 (15:24 -0400)] 
- 0.9.5. setup
- changelog file setup

Change-Id: I1edd9e055740c9826c4f89d6d74fb12f5e3f58ce

8 years ago- 0.9.4 rel_0_9_4
Mike Bayer [Tue, 1 Aug 2017 02:06:28 +0000 (22:06 -0400)] 
- 0.9.4

8 years agoaddress stamp issues in on_version_apply callback
jpassaro [Mon, 10 Jul 2017 19:51:46 +0000 (15:51 -0400)] 
address stamp issues in on_version_apply callback

* add callback tests with stamp present
* fix bug in stamp MigrationInfo construction
* adjust MigrationInfo API to reflect existence of stamps with multiple
  up revisions

Change-Id: I308d1de7854542d4d12bcc743bb5ed7e8e2fbefc
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/68

8 years ago- 0.9.4 setup
Mike Bayer [Mon, 17 Jul 2017 14:33:25 +0000 (10:33 -0400)] 
- 0.9.4 setup

Change-Id: Id951f3ff26b34a03a519b634d1cd7cbf0223f849

8 years ago- 0.9.3 rel_0_9_3
Mike Bayer [Thu, 6 Jul 2017 15:59:21 +0000 (11:59 -0400)] 
- 0.9.3

8 years ago- fix some sphinx link stuff
Mike Bayer [Thu, 6 Jul 2017 15:59:04 +0000 (11:59 -0400)] 
- fix some sphinx link stuff

8 years agoexpose on_version_apply callback to context users
John Passaro [Tue, 27 Jun 2017 18:36:11 +0000 (14:36 -0400)] 
expose on_version_apply callback to context users

Change-Id: I694e26f7d161dcaf4f035277c8317ff6ffe41680
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/67

8 years agoAdjust for Variant returning itself as impl
Mike Bayer [Fri, 2 Jun 2017 14:20:27 +0000 (10:20 -0400)] 
Adjust for Variant returning itself as impl

Fixed bug where autogen comparison of a :class:`.Variant` datatype
would not compare to the dialect level type for the "default"
implementation of the :class:`.Variant`, returning the type as changed
between database and table metadata.

Change-Id: Ie94779ece9f1c768375cdbdc4124c98f9c11bb86
Fixes: #433
8 years ago - add dateutil to docs requirements so that all autodoc
Mike Bayer [Thu, 1 Jun 2017 14:59:33 +0000 (10:59 -0400)] 
 - add dateutil to docs requirements so that all autodoc
modules can import

Change-Id: I9f9943bfa99ac2581cd1579549a533eddefdc191

8 years ago- Fixed unit tests to run correctly under the SQLAlchemy 1.0.x series
Mike Bayer [Wed, 31 May 2017 21:12:41 +0000 (17:12 -0400)] 
- Fixed unit tests to run correctly under the SQLAlchemy 1.0.x series
prior to version 1.0.10 where a particular bug involving Postgresql
exclude constraints was fixed.

Change-Id: Ief64b19b75e4c2c3661ac95d5b03d0c8e0fe5619
Fixes: #431
8 years ago- 0.9.3 setup
Mike Bayer [Wed, 31 May 2017 21:11:09 +0000 (17:11 -0400)] 
- 0.9.3 setup

Change-Id: I151d45645826badad0d398d5178a468f50fb8234

8 years ago- 0.9.2 rel_0_9_2
Mike Bayer [Thu, 18 May 2017 15:04:28 +0000 (11:04 -0400)] 
- 0.9.2

8 years agoDon't use schema with second argument, SQL Server sp_rename
Mike Bayer [Thu, 18 May 2017 14:36:13 +0000 (10:36 -0400)] 
Don't use schema with second argument, SQL Server sp_rename

Repaired :meth:`.Operations.rename_table` for SQL Server when the
target table is in a remote schema, the schema name is omitted from
the "new name" argument.

Also added some extra tests for sp_rename w/ quoting / case sensitive
names.

Change-Id: I411b32d0c5bba5a466c0b5d6a412c1b7541fdc95
Fixes: #429
8 years agoAdd timezone option to config
Mike Bayer [Thu, 6 Apr 2017 17:55:35 +0000 (13:55 -0400)] 
Add timezone option to config

Using dateutil.tz to link string names to tzinfo objects,
the create_date can now generate using a named timezone
rather than datetime.now().

Change-Id: I9f151cb9e11da3d68be63d7141f60e7eccb9812c
Fixes: #425
8 years agoApply DDLCompiler name rules to Index for autogenerate
Mike Bayer [Wed, 15 Mar 2017 21:10:28 +0000 (17:10 -0400)] 
Apply DDLCompiler name rules to Index for autogenerate

The autogenerate compare scheme now takes into account the name truncation
rules applied by SQLAlchemy's DDL compiler to the names of the
:class:`.Index` object, when these names are dynamically truncated
due to a too-long identifier name.   As the identifier truncation is
deterministic, applying the same rule to the metadata name allows
correct comparison to the database-derived name.

Change-Id: I270fbde4430a41f4bcc7857f1932347d86f07675
Fixes: #421
8 years ago- fix the import here
Mike Bayer [Wed, 15 Mar 2017 21:09:24 +0000 (17:09 -0400)] 
- fix the import here

Change-Id: I63fa57218fcc8f3d15c213c8adf61c9761cb9764

8 years ago- add custom css also
Mike Bayer [Wed, 15 Mar 2017 16:06:15 +0000 (12:06 -0400)] 
- add custom css also

Change-Id: I163f3f644e88460cdb5203e8a55944436c06d00b

8 years ago- add custom sidebar file
Mike Bayer [Wed, 15 Mar 2017 15:54:55 +0000 (11:54 -0400)] 
- add custom sidebar file

Change-Id: I03078ee419882942a5891c90cef18851b53f905b

8 years agoWarn on non-Connection present and accommodate for Engine
Mike Bayer [Sat, 4 Mar 2017 21:42:30 +0000 (16:42 -0500)] 
Warn on non-Connection present and accommodate for Engine

A warning is emitted when an object that's not a
:class:`~sqlalchemy.engine.Connection` is passed to
:meth:`.EnvironmentContext.configure`.  For the case of a
:class:`~sqlalchemy.engine.Engine` passed, the check for "in transaction"
introduced in version 0.9.0 has been relaxed to work in the case of an
attribute error, as some users appear to be passing an
:class:`~sqlalchemy.engine.Engine` and not a
:class:`~sqlalchemy.engine.Connection`.

Change-Id: I95ef38955c00511d3055362a03284fb91677595f
Fixes: #419
8 years ago- 0.9.2 setup
Mike Bayer [Sat, 4 Mar 2017 21:43:10 +0000 (16:43 -0500)] 
- 0.9.2 setup

Change-Id: I4459aeef0028c89ac1c30e79cbceefe3b0c27f64

8 years ago- 0.9.1 rel_0_9_1
Mike Bayer [Wed, 1 Mar 2017 16:51:34 +0000 (11:51 -0500)] 
- 0.9.1

8 years agoDon't raise on open transaction if we already started in one
Mike Bayer [Wed, 1 Mar 2017 06:14:50 +0000 (01:14 -0500)] 
Don't raise on open transaction if we already started in one

An adjustment to the bug fix for :ticket:`369` to accommodate for
env.py scripts that use an enclosing transaction distinct from the
one that the context provides, so that the check for "didn't commit
the transaction" doesn't trigger in this scenario.

Change-Id: I3c1fa614495b61532999a84b2af3773e4d33c30b
Fixes: #417
8 years ago- setup for 0.9.1
Mike Bayer [Wed, 1 Mar 2017 06:03:12 +0000 (01:03 -0500)] 
- setup for 0.9.1

Change-Id: I84fa995b7c029404988f04df4fa1460c4409c7da

8 years ago- 0.9.0 rel_0_9_0
Mike Bayer [Tue, 28 Feb 2017 15:58:48 +0000 (10:58 -0500)] 
- 0.9.0

8 years ago- provide param docstrings for all of command
Mike Bayer [Mon, 27 Feb 2017 20:57:33 +0000 (15:57 -0500)] 
- provide param docstrings for all of command
- add cross-linking for process_revision_directives

Change-Id: I88914df056d720207c781501934893ec8e030610

8 years agoAllow target_metadata to be a sequence
Mike Bayer [Thu, 23 Feb 2017 17:57:40 +0000 (12:57 -0500)] 
Allow target_metadata to be a sequence

The :paramref:`.EnvironmentContext.configure.target_metadata` parameter
may now be optionally specified as a sequence of :class:`.MetaData`
objects instead of a single :class:`.MetaData` object.  The
autogenerate process will process the sequence of :class:`.MetaData`
objects in order.

Change-Id: I6485c05d68219ff7af1611b34550487d316e0242
Fixes: #38
8 years agoDetect open transaction at end of migration w/ transactional_ddl=False
Mike Bayer [Thu, 23 Feb 2017 16:18:57 +0000 (11:18 -0500)] 
Detect open transaction at end of migration w/ transactional_ddl=False

A :class:`.CommandError` is now raised when a migration file opens
a database transaction and does not close/commit/rollback, when
the backend database or environment options also specify transactional_ddl
is False.   When transactional_ddl is not in use, Alembic doesn't
close any transaction so a transaction opened by a migration file
will cause the following migrations to fail to apply.

Change-Id: I7a9baf18837deb193d9ddc6813955909484d4945
Fixes: #369
8 years agoApply subtype repr logic to JSON/JSONB
Mike Bayer [Wed, 22 Feb 2017 21:59:09 +0000 (16:59 -0500)] 
Apply subtype repr logic to JSON/JSONB

Fixed bug where Postgresql JSON/JSONB types rendered on SQLAlchemy
1.1 would render the "astext_type" argument which defaults to
the ``Text()`` type without the module prefix, similarly to the
issue with ARRAY fixed in :ticket:`85`.

Also modifies the ARRAY approach from :ticket:`85` to be
regular expression based for safer targeting of the inner
repr() type.

Change-Id: I66d51301f4bf5b747b5e8da26a83cbff075d71b2
Fixes: #411
8 years agoMerge "Add ExcludeConstraint support for Postgresql"
mike bayer [Wed, 22 Feb 2017 22:35:37 +0000 (17:35 -0500)] 
Merge "Add ExcludeConstraint support for Postgresql"

8 years agoAdd ExcludeConstraint support for Postgresql
Mike Bayer [Mon, 20 Feb 2017 21:54:07 +0000 (16:54 -0500)] 
Add ExcludeConstraint support for Postgresql

Add full support for Postgresql add_exclude_constraint().
This opens up more of the operations API and serves as a
model for other dialect-specific constraints.

Additionally, gracefully degrade if a given constraint
class is not supported with a warning.

Fixes: #412
Change-Id: I0fb89c840518aaeae97929919356f944479bc756

8 years agoDetect and render autoincrement for alter_column()
Mike Bayer [Wed, 22 Feb 2017 17:51:53 +0000 (12:51 -0500)] 
Detect and render autoincrement for alter_column()

The ``autoincrement=True`` flag is now rendered within the
:meth:`.Operations.alter_column` operation if the source column indicates
that this flag should be set to True.  The behavior is sensitive to
the SQLAlchemy version in place, as the "auto" default option is new
in SQLAlchemy 1.1.  When the source column indicates autoincrement
as True or "auto", the flag will render as True if the original column
contextually indicates that it should have "autoincrement" keywords,
and when the source column explcitly sets it to False, this is also
rendered.  The behavior is intended to preserve the AUTO_INCREMENT flag
on MySQL as the column is fully recreated on this backend.  Note that this
flag does **not** support alteration of a column's "autoincrement" status,
as this is not portable across backends.

Change-Id: I746c4841752adf9342bfdca7c9255aae5110b2ef
Fixes: #413
8 years agoAdd process_revision_directives param to command.revision()
Mike Bayer [Mon, 30 Jan 2017 14:34:52 +0000 (09:34 -0500)] 
Add process_revision_directives param to command.revision()

This allows programmatic use of command.revision() to
specify an ad-hoc process_revision_directives callable,
rather than having it placed via the env.py script.

Co-authored-by: Tyson Holub
Change-Id: Ief1c11fd2a6f10e712851145d6d190a3b167817c
Pull-request: https://github.com/zzzeek/alembic/pull/35

8 years agoFix postgresql automigration for ARRAY types
Paul [Mon, 20 Feb 2017 20:20:17 +0000 (15:20 -0500)] 
Fix postgresql automigration for ARRAY types

Adds a new codepath into render._repr_type() that will consult
the dialect impl for specific types.  On the postgresql side,
the exisiting repr() is combined with a replace featuring
the full autogen render of the nested type.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #85
Change-Id: I8796bfeea27d48e6f8bb5ea4562bdc04961ba0d5
Pull-request: https://github.com/zzzeek/alembic/pull/38

8 years ago- import adjusted for older SQLA
Mike Bayer [Tue, 21 Feb 2017 19:54:18 +0000 (14:54 -0500)] 
- import adjusted for older SQLA

Change-Id: I998c65f8c9b2901adf02cf6796e9940fae630309

8 years ago- fix
Mike Bayer [Tue, 21 Feb 2017 16:54:23 +0000 (11:54 -0500)] 
- fix

Change-Id: I477ecc68baea7997c00904f0647f50cf15bfe50f

8 years ago- call this 0.9.0, as there are some slight architectural changes
Mike Bayer [Tue, 21 Feb 2017 16:45:07 +0000 (11:45 -0500)] 
- call this 0.9.0, as there are some slight architectural changes
coming

Change-Id: I98d8edf6b05281bfbc4f3a4338f02084a759a9f8

8 years ago- move Postgresql-related render tests to the test_postgresql suite
Mike Bayer [Tue, 21 Feb 2017 16:44:20 +0000 (11:44 -0500)] 
- move Postgresql-related render tests to the test_postgresql suite

Change-Id: I5e5659739269284c41bc9a7ae3127fb5d72d108f

8 years agoEnsure schema names also compared in foreign_key_constraint()
Konstantin Lebedev [Mon, 20 Feb 2017 16:28:06 +0000 (11:28 -0500)] 
Ensure schema names also compared in foreign_key_constraint()

Fixed bug in :func:`.ops.create_foreign_key` where the internal table
representation would not be created properly if the foriegn key referred
to a table in a different schema of the same name.  Pull request
courtesy Konstantin Lebedev.

Change-Id: I494c95d02aedbfec3b6318d069322b544cf018fb
Pull-request: https://github.com/zzzeek/alembic/pull/36

8 years ago- 0.8.11 bump changelog also
Mike Bayer [Mon, 20 Feb 2017 14:10:35 +0000 (09:10 -0500)] 
- 0.8.11 bump changelog also

Change-Id: I3a1b149a8b04097d0f3eb56d94add322f87903a7

8 years agoFix link in batch alter_column doc
Hemanth Makkapati [Mon, 13 Feb 2017 18:51:40 +0000 (12:51 -0600)] 
Fix link in batch alter_column doc

Refer to Operations.alter_column instead of Operations.add_column

8 years ago- 0.8.11 dev bump
Mike Bayer [Wed, 25 Jan 2017 19:45:16 +0000 (14:45 -0500)] 
- 0.8.11 dev bump

Change-Id: I2fdac1caaef103919e373537f9db297b058a7543

8 years ago- add a note that alter_column->postgresql_using is raw SQL,
Mike Bayer [Wed, 25 Jan 2017 14:34:41 +0000 (09:34 -0500)] 
- add a note that alter_column->postgresql_using is raw SQL,
fixes #408

Change-Id: Ia569191d43d49178f78a7bcef458b671f750583e

8 years ago- add a new section "Run Multiple Alembic Environments from one .ini file",
Mike Bayer [Mon, 23 Jan 2017 19:24:31 +0000 (14:24 -0500)] 
- add a new section "Run Multiple Alembic Environments from one .ini file",
clarify what the --name flag does and how this differs from
"multiple bases".

Change-Id: If65a8a11802db18bc2f42ffea360c70cbc9113bb

8 years ago- 0.8.10 rel_0_8_10
Mike Bayer [Tue, 17 Jan 2017 18:53:12 +0000 (13:53 -0500)] 
- 0.8.10

8 years agoUpdate pytest section in setup.cfg
Mike Bayer [Tue, 17 Jan 2017 17:18:43 +0000 (12:18 -0500)] 
Update pytest section in setup.cfg

Uses new [tool:pytest] directive.
Also removes tox minversion as we are well ahead of that version.

Change-Id: I32c767b8daa64c9e8d71a68c4f568d275719c7d7

8 years agoAdd primary key constraint to alembic_version
Mike Bayer [Wed, 11 Jan 2017 14:33:01 +0000 (09:33 -0500)] 
Add primary key constraint to alembic_version

The alembic_version table, when initially created, now establishes a
primary key constraint on the "version_num" column, to suit database
engines that don't support tables without primary keys.   This behavior
can be controlled using the parameter
:paramref:`.EnvironmentContext.configure.version_table_pk`.  Note that
this change only applies to the initial creation of the alembic_version
table; it does not impact any existing alembic_version table already
present.

Change-Id: Ic947f0f97373b2e6695e06c9b2ad6c8a9789fcb2
Fixes: #406
8 years agoMerge "- test py36 - Current mysqlclient does not accept "bytes" on py3k, SQLAlchemy...
mike bayer [Thu, 12 Jan 2017 18:47:55 +0000 (13:47 -0500)] 
Merge "- test py36 - Current mysqlclient does not accept "bytes" on py3k, SQLAlchemy 0.9 still lists this client (the original mysqldb version) as "supports_unicode_statements=False" so is no longer functional on py3k. - Rollback transaction after table drop; it seems py3.6 sqlite3 suddenly turned on transactional DDL for SQLite"

8 years ago- test py36
Mike Bayer [Wed, 11 Jan 2017 15:29:57 +0000 (10:29 -0500)] 
- test py36
- Current mysqlclient does not accept "bytes" on py3k, SQLAlchemy 0.9
still lists this client (the original mysqldb version) as
"supports_unicode_statements=False" so is no longer functional on py3k.
- Rollback transaction after table drop; it seems py3.6 sqlite3
suddenly turned on transactional DDL for SQLite

Change-Id: Ic3b7881583bde5602e54811cf6a149761038b9fd

8 years agoGeneralize uq -> uix dedupe logic
Mike Bayer [Tue, 3 Jan 2017 21:24:42 +0000 (16:24 -0500)] 
Generalize uq -> uix dedupe logic

Adjusted the logic originally added for :ticket:`276` that detects MySQL
unique constraints which are actually unique indexes to be generalized
for any dialect that has this behavior, for SQLAlchemy version 1.0 and
greater.  This is to allow for upcoming SQLAlchemy support for unique
constraint reflection for Oracle, which also has no dedicated concept of
"unique constraint" and instead establishes a unique index.

Change-Id: Ie5770aba36005ec8618bdc18bc4633413d37fc16

8 years agoMerge "Get test compat for oracle"
mike bayer [Mon, 9 Jan 2017 19:23:22 +0000 (14:23 -0500)] 
Merge "Get test compat for oracle"

8 years agoGet test compat for oracle
Mike Bayer [Wed, 4 Jan 2017 16:24:26 +0000 (11:24 -0500)] 
Get test compat for oracle

Start getting all the exclusions and conventions in place
to get the autogen suites to pass against the oracle dialect

Change-Id: I63b8c46311af4fc77da6baf17b628a64e9748f85

8 years ago- happy new year
Mike Bayer [Wed, 4 Jan 2017 17:41:05 +0000 (12:41 -0500)] 
- happy new year

Change-Id: I88881e76cd37653f338d1aa8a4c76463ea3cdc77

8 years agoEnsure primary_key flag unset for PK batch drop
Mike Bayer [Mon, 19 Dec 2016 16:04:43 +0000 (11:04 -0500)] 
Ensure primary_key flag unset for PK batch drop

Fixed bug where doing ``batch_op.drop_constraint()`` against the
primary key constraint would fail to remove the "primary_key" flag
from the column, resulting in the constraint being recreated.

Change-Id: I20c04860b151ac86466337f0522018be06c6feec
Fixes: #402
8 years agoIgnore py files generated by emacs
Markus Mattes [Mon, 28 Nov 2016 22:32:27 +0000 (17:32 -0500)] 
Ignore py files generated by emacs

Added a file ignore for Python files of the form ``.#<name>.py``,
which are generated by the Emacs editor.  Pull request courtesy
Markus Mattes.

Change-Id: I06861c2ba7b8e6730948c01ff0690b50bdb26f0f
Pull-request: https://github.com/zzzeek/alembic/pull/32
Fixes: #356
8 years ago- 0.8.10 setup
Mike Bayer [Mon, 28 Nov 2016 22:39:40 +0000 (17:39 -0500)] 
- 0.8.10 setup

Change-Id: I260ddb041a41524ffd0b252cd791cf155fab29eb

8 years ago- 0.8.9 rel_0_8_9
Mike Bayer [Mon, 28 Nov 2016 17:14:07 +0000 (12:14 -0500)] 
- 0.8.9

8 years agoMerge "Add single pound to generated comments"
mike bayer [Mon, 28 Nov 2016 16:22:27 +0000 (11:22 -0500)] 
Merge "Add single pound to generated comments"

8 years agocast() types in batch only if type_affinity is different
Mike Bayer [Wed, 23 Nov 2016 19:42:19 +0000 (14:42 -0500)] 
cast() types in batch only if type_affinity is different

Batch mode will not use CAST() to copy data if type_ is given, however
the basic type affinity matches that of the existing type.  This to
avoid SQLite's CAST of TIMESTAMP which results in truncation of the
data, in those cases where the user needs to add redundant type_ for
other reasons.

Change-Id: I20f7b399cd3cd7740d67ff7d624aa1da874ebc71
Fixes: #391
8 years agofile generated by alembic revison is now pep8 compliant
Markus Mattes [Mon, 21 Nov 2016 17:05:23 +0000 (12:05 -0500)] 
file generated by alembic revison is now pep8 compliant

Change-Id: I233d2ba2cbbe6a363d9118182f1d855a6a12b00c
Pull-request: https://github.com/zzzeek/alembic/pull/31

8 years agoDetect and ignore duplicate revision files on read
Jiri Kuncar [Fri, 18 Nov 2016 18:40:24 +0000 (13:40 -0500)] 
Detect and ignore duplicate revision files on read

Added an additional check when reading in revision files to detect
if the same file is being read twice; this can occur if the same directory
or a symlink equivalent is present more than once in version_locations.
A warning is now emitted and the file is skipped.  Pull request courtesy
Jiri Kuncar.

Change-Id: I10ffc8eff420d18c55d3533afb9d5935bbadfe32
Pull-request: https://github.com/zzzeek/alembic/pull/30