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

8 years ago- bump changelog for version that supports additional .. change:: tags
Mike Bayer [Tue, 15 Nov 2016 21:12:47 +0000 (16:12 -0500)] 
- bump changelog for version that supports additional .. change:: tags

Change-Id: I59fdc96b4aa16b6647eb97497a0270a99db40016

8 years agoAdd single pound to generated comments
Maico Timmerman [Tue, 15 Nov 2016 20:39:18 +0000 (15:39 -0500)] 
Add single pound to generated comments

Adjustment to the "please adjust!" comment in the script.py.mako
template so that the generated comment starts with a single pound
sign, appeasing flake8.

Change-Id: I4b425d2fa8701cabf8352d046b3342a73f78c70d
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/65
Partially-fixes: #393

8 years agoCompare to metadata_impl in compare_type() to guard against custom TypeDecorator
Mike Bayer [Wed, 9 Nov 2016 13:42:12 +0000 (08:42 -0500)] 
Compare to metadata_impl in compare_type() to guard against custom TypeDecorator

Fixed bug where usage of a custom TypeDecorator which returns a
per-dialect type via :meth:`.TypeDecorator.load_dialect_impl` that differs
significantly from the default "impl" for the type decorator would fail
to compare correctly during autogenerate.

Change-Id: I384df35be9513bf8a2ae55e7daa9a52c23108a49
Fixes: #395
8 years agoUnwrap unaryexpression when testing for functional index
Mike Bayer [Fri, 28 Oct 2016 13:17:42 +0000 (09:17 -0400)] 
Unwrap unaryexpression when testing for functional index

Fixed bug in Postgresql "functional index skip" behavior where a
functional index that ended in ASC/DESC wouldn't be detected as something
we can't compare in autogenerate, leading to duplicate definitions
in autogenerated files.

Change-Id: I0fdfee69a89da575078a687bb4551088fb1b67d7
Fixes: #392
8 years agoSupport explicit "base" in --sql mode.
Mike Bayer [Wed, 21 Sep 2016 15:28:40 +0000 (11:28 -0400)] 
Support explicit "base" in --sql mode.

Fix bug where "alembic upgrade base:head --sql" would fail.
Behavior is now equivalent to "alembic upgrade head --sql".

Change-Id: Ic730541c3ce6af01fe892811fd3cc6643e0459a6
Fixes: #388
8 years ago- 0.8.8 rel_0_8_8
Mike Bayer [Mon, 12 Sep 2016 22:20:49 +0000 (18:20 -0400)] 
- 0.8.8

8 years ago- fix changelog
Mike Bayer [Mon, 12 Sep 2016 22:20:10 +0000 (18:20 -0400)] 
- fix changelog

Change-Id: Ie07967808e940664043fabd03137c328a9b702b7

8 years agoThe imports in the default script.py.mako are now at the top
Mike Bayer [Mon, 12 Sep 2016 22:11:44 +0000 (18:11 -0400)] 
The imports in the default script.py.mako are now at the top
so that flake8 editors don't complain by default.  PR courtesy
Guilherme Mansur.

Change-Id: Ie38810df0f36a08b8fdd36f4a6a0ec243515dc34

8 years agoInclude DateTime.timezone in autogen type comparisons
David Szotten [Fri, 17 Jun 2016 16:54:57 +0000 (12:54 -0400)] 
Include DateTime.timezone in autogen type comparisons

Change-Id: I2e5b380625ec45d5ebc0bc74daf9cf9e05f0155a
Pull-request: https://github.com/zzzeek/alembic/pull/26

8 years agoSupport USING for Postgresql ALTER COLUMN.
Frazer McLean [Fri, 17 Jun 2016 16:55:11 +0000 (12:55 -0400)] 
Support USING for Postgresql ALTER COLUMN.

Added support for the USING clause to the ALTER COLUMN operation
for Postgresql.  Support is via the
:paramref:`.op.alter_column.postgresql_using`
parameter.

Fixes: #292
Change-Id: I8b1d418df0b6b731a68614dbffd7a9fb13de4de5
Pull-request: https://github.com/zzzeek/alembic/pull/27

8 years agoMove op tests for Postgresql to test_postgresql
Mike Bayer [Mon, 22 Aug 2016 15:22:28 +0000 (11:22 -0400)] 
Move op tests for Postgresql to test_postgresql

This moves tests for op features specific to Postgresql.
Note this does not include tests in test_op that
make use of the postgresql backend just for "schema" support.

Change-Id: I82b4326bbc3a2c520891214c8e8254da36bd8f2a

8 years ago- placeholder for 0.8.8
Mike Bayer [Mon, 22 Aug 2016 14:55:04 +0000 (10:55 -0400)] 
- placeholder for 0.8.8

Change-Id: Ibf639c01d4abcfe301055d6bbee0305ae9765d79

9 years ago- adjust test to correct for SQLAlchemy issue #3766
Mike Bayer [Thu, 4 Aug 2016 18:19:02 +0000 (14:19 -0400)] 
- adjust test to correct for SQLAlchemy issue #3766

Change-Id: Iaffc0592be1b7c987444a18846759fa343bb822e

9 years ago- 0.8.7 rel_0_8_7
Mike Bayer [Tue, 26 Jul 2016 14:48:01 +0000 (10:48 -0400)] 
- 0.8.7

9 years agoDon't raise RangeNotAncestor for sibling branches
Mike Bayer [Mon, 18 Jul 2016 21:17:53 +0000 (17:17 -0400)] 
Don't raise RangeNotAncestor for sibling branches

Fixed bug where upgrading to the head of a branch which is already
present would fail, only if that head were also the dependency
of a different branch that is also upgraded, as the revision system
would see this as trying to go in the wrong direction.   The check
here has been refined to distinguish between same-branch revisions
out of order vs. movement along sibling branches.

When we're about to claim an error due to
"alembic upgrade greater to lower", make sure this
isn't a request to hit a node in a different branch
that's already implied.

Change-Id: I8641162bb05c6226f0ea12b88b548df41f5a6b51
Fixes: #336
9 years agoMerged in AlfredPerlstein/alembic/fix_doclink (pull request #59)
Michael Bayer [Mon, 18 Jul 2016 14:57:01 +0000 (10:57 -0400)] 
Merged in AlfredPerlstein/alembic/fix_doclink (pull request #59)

Fix doclink away from readthedocs

9 years agoFix doclink away from readthedocs
Alfred Perlstein [Mon, 18 Jul 2016 01:29:14 +0000 (18:29 -0700)] 
Fix doclink away from readthedocs

9 years agoDon't remove dependent version when downgrading to a version.
Mike Bayer [Tue, 12 Jul 2016 19:05:09 +0000 (15:05 -0400)] 
Don't remove dependent version when downgrading to a version.

Adjusted the version traversal on downgrade
such that we can downgrade to a version that is a dependency for
a version in a different branch, *without* needing to remove that
dependent version as well.  Previously, the target version would be
seen as a "merge point" for it's normal up-revision as well as the
dependency.  This integrates with the changes for :ticket:`377`
and :ticket:`378` to improve treatment of branches with dependencies
overall.

Change-Id: Ica0732f6419f68ab85650170839ac8000ba3bbfb
Fixes: #379
9 years agoDetect downgrades over dependencies distinctly from unmerge
Mike Bayer [Sun, 10 Jul 2016 20:23:21 +0000 (16:23 -0400)] 
Detect downgrades over dependencies distinctly from unmerge

Previously, a downgrade to a version that is also a dependency
to another branch, where that branch is advanced beyond
the target, would fail to be downgraded, as this would
be detected as an "umerge" even though the target version
to be INSERTed would not be present.
The patch replaces the existing heuristic
that checks for "delete" with a new one that calculates
a potential "unmerge" fully, and returns False only if we in
fact could do an unmerge.

Also change the string display of a version so that we don't
display misleading target versions that might not actually
be getting invoked.

Fixes: #377
Change-Id: I7420dd7adbd9ccf9ca85b56d9a792a85c40f3454

9 years agoReport on other branch dependencies in "current"
Mike Bayer [Mon, 11 Jul 2016 19:27:45 +0000 (15:27 -0400)] 
Report on other branch dependencies in "current"

Fixed bug where the "alembic current" command wouldn't show a revision
as a current head if it were also a dependency of a version in a
different branch that's also applied.   Extra logic is added to
extract "implied" versions on different branches from the top-level
versions listed in the alembic_version table.

Change-Id: I9f485fbc67555d13f737ecffdd25e4c0d8e33f1c
Fixes: #378
9 years agoEnsure tuples are passed correctly in Revision.__repr__
Mike Bayer [Mon, 11 Jul 2016 15:42:13 +0000 (11:42 -0400)] 
Ensure tuples are passed correctly in Revision.__repr__

Fixed bug where a repr() or str() of a Script object would fail
if the script had multiple dependencies.

Change-Id: Iae866058cce4ec5a7dc499358b23b06a4bbb6ecd

9 years agoDon't remove None for default schema of None
Mike Bayer [Wed, 29 Jun 2016 20:22:24 +0000 (16:22 -0400)] 
Don't remove None for default schema of None

Fixed bug in autogen where if the DB connection sends the default
schema as "None", this "None" would be removed from the list of
schemas to check if include_schemas were set.  This could possibly
impact using include_schemas with SQLite.

Change-Id: I553cdbbe2cfaa5228d86019e14f7c9f56231f295

9 years ago- adjust boolean no_ck test to not use Boolean type
Mike Bayer [Fri, 24 Jun 2016 02:19:55 +0000 (22:19 -0400)] 
- adjust boolean no_ck test to not use Boolean type
to insert a non 0/1 integer; SQLA 1.1 now coerces it to
1/0

Change-Id: I4447547b98a5178c7a1185d5788bfb58ae8c23ee

9 years agoMerged in gkrimer/alembic/cookbook-additions (pull request #58)
Mike Bayer [Wed, 22 Jun 2016 14:11:15 +0000 (10:11 -0400)] 
Merged in gkrimer/alembic/cookbook-additions (pull request #58)

Adding cookbook recipe for excluding views from migrations.

9 years agoAdding cookbook recipe for excluding views from migrations.
Greg Krimer [Tue, 21 Jun 2016 16:30:45 +0000 (11:30 -0500)] 
Adding cookbook recipe for excluding views from migrations.

9 years ago- now at alembic.zzzcomputing.com
Mike Bayer [Sat, 18 Jun 2016 03:48:05 +0000 (23:48 -0400)] 
- now at alembic.zzzcomputing.com

Change-Id: I740b6e65e14f9b6417ecce0b6bb1853a9037bf05

9 years ago- didn't work. sadface
Mike Bayer [Sat, 18 Jun 2016 02:14:00 +0000 (22:14 -0400)] 
- didn't work.  sadface

Change-Id: I59e31c4aa4f5e25b230f4d2e211cb6448f3339ac

9 years ago- attempt to get RTD to include the correct searchtools
Mike Bayer [Sat, 18 Jun 2016 01:05:32 +0000 (21:05 -0400)] 
- attempt to get RTD to include the correct searchtools

Change-Id: Iafb3854e85a48874410235483e4d474f24d6fe52

9 years ago- bump sphinx-paramlinks, trying to get builds to work on RTD
Mike Bayer [Fri, 17 Jun 2016 19:05:52 +0000 (15:05 -0400)] 
- bump sphinx-paramlinks, trying to get builds to work on RTD

Change-Id: Ie57c3f6a26ced7493665be509c6fdfd3d290022d

9 years agoAdd .gitreview
Mike Bayer [Fri, 17 Jun 2016 14:42:24 +0000 (10:42 -0400)] 
Add .gitreview

Change-Id: I97f2929d278c7807be1e4f46ef0a4456995b9dc5

9 years ago- SQlite supports reflection of ON UPDATE / ON DELETE in SQLA 1.1
Mike Bayer [Fri, 3 Jun 2016 19:10:01 +0000 (15:10 -0400)] 
- SQlite supports reflection of ON UPDATE / ON DELETE in SQLA 1.1
- this reflection retains the original case

9 years ago- repair typo
Mike Bayer [Thu, 2 Jun 2016 13:13:52 +0000 (09:13 -0400)] 
- repair typo

9 years ago- version bump
Mike Bayer [Wed, 1 Jun 2016 22:08:02 +0000 (18:08 -0400)] 
- version bump

9 years ago- Small adjustment made to the batch handling for reflected CHECK
Mike Bayer [Wed, 1 Jun 2016 22:07:40 +0000 (18:07 -0400)] 
- Small adjustment made to the batch handling for reflected CHECK
constraints to accommodate for SQLAlchemy 1.1 now reflecting these.
Batch mode still does not support CHECK constraints from the reflected
table as these can't be easily differentiated from the ones created
by types such as Boolean.

9 years agoMerged in kveretennicov/alembic/kveretennicov/-update-cookbook-wording-to-reflect...
Mike Bayer [Tue, 24 May 2016 20:31:49 +0000 (16:31 -0400)] 
Merged in kveretennicov/alembic/kveretennicov/-update-cookbook-wording-to-reflect-that-1463688141291 (pull request #57)

- update Cookbook wording to reflect that it contains multiple recipes now