Releases: sqlalchemy/alembic
0.9.7
0.9.7
Released: January 16, 2018
-
[autogenerate] [bug] Fixed regression caused by #421 which would
cause case-sensitive quoting rules to interfere with the
comparison logic for index names, thus causing indexes to show
as added for indexes that have case-sensitive names. Works with
SQLAlchemy 0.9 and later series.References: #472
-
[autogenerate] [bug] [postgresql] 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.References: #461
0.9.6
0.9.6
Released: October 13, 2017
-
[bug] [commands] Fixed a few Python3.6 deprecation warnings by replacing
StopIteration
withreturn
, as well as usinggetfullargspec()
instead of
getargspec()
under Python 3.References: #458
-
[bug] [commands] An addition to #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.References: #441
-
[autogenerate] [bug] Fixed bug expanding upon the fix for
#85 which adds the correct module import to the
"inner" type for anARRAY
type, the fix now accommodates for the
genericsqlalchemy.types.ARRAY
type added in SQLAlchemy 1.1,
rendering the inner type correctly regardless of whether or not the
Postgresql dialect is present.References: #442
-
[bug] [mysql] 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.References: #455
-
[autogenerate] [bug] Fixed bug where comparison of
Numeric
types would produce
a difference if the Python-sideNumeric
inadvertently specified
a non-None "scale" with a "precision" of None, even though thisNumeric
type will pass over the "scale" argument when rendering. Pull request
courtesy Ivan Mmelnychuk. -
[commands] [feature] The
alembic history
command will now make use of the revision
environmentenv.py
unconditionally if therevision_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.References: #447
-
[batch] [bug] 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.References: #457
-
[autogenerate] [bug] A
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.References: #456
-
[bug] [py3k] [runtime] 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 inversions/__pycache__
, deduplicating
version files that may be inversions/__pycache__
andversions/
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.References: #449
0.9.5
0.9.5
Released: August 9, 2017
-
[bug] [commands] A
CommandError
is raised if the "--rev-id" passed to the
revision()
command contains dashes or at-signs, as this interferes
with the command notation used to locate revisions.References: #441
-
[bug] [postgresql] Added support for the dialect-specific keyword arguments
toOperations.drop_index()
. This includes support for
postgresql_concurrently
and others.References: #424
-
[bug] [commands] Fixed bug in timezone feature introduced in
#425 when the creation
date in a revision file is calculated, to
accommodate for timezone names that contain
mixed-case characters in their name as opposed
to all uppercase. Pull request courtesy Nils
Philippsen.
0.9.4
0.9.4
Released: July 31, 2017
- [bug] [runtime] Added an additional attribute to the new
EnvironmentContext.configure.on_version_apply
API,
MigrationInfo.up_revision_ids
, to accommodate for the uncommon
case of thealembic stamp
command being used to move from multiple
branches down to a common branchpoint; there will be multiple
"up" revisions in this one case.
0.9.3
0.9.3
Released: July 6, 2017
-
[feature] [runtime] Added a new callback hook
EnvironmentContext.configure.on_version_apply
,
which allows user-defined code to be invoked each time an individual
upgrade, downgrade, or stamp operation proceeds against a database.
Pull request courtesy John Passaro. -
[autogenerate] [bug] Fixed bug where autogen comparison of a
Variant
datatype
would not compare to the dialect level type for the "default"
implementation of theVariant
, returning the type as changed
between database and table metadata.References: #433
-
[bug] [tests] 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.References: #431
0.9.2
0.9.2
Released: May 18, 2017
-
[bug] [mssql] Repaired
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.References: #429
-
[commands] [feature] Added a new configuration option
timezone
, a string timezone name
that will be applied to the create date timestamp rendered
inside the revision file as made availble to thefile_template
used
to generate the revision filename. Note this change adds the
python-dateutil
package as a dependency.References: #425
-
[autogenerate] [bug] The autogenerate compare scheme now takes into account the name truncation
rules applied by SQLAlchemy's DDL compiler to the names of the
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.References: #421
-
[bug environment] A warning is emitted when an object that's not a
~sqlalchemy.engine.Connection
is passed to
EnvironmentContext.configure()
. For the case of a
~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
~sqlalchemy.engine.Engine
and not a
~sqlalchemy.engine.Connection
.References: #419
0.9.1
0.9.1
Released: March 1, 2017
0.9.0
0.9.0
Released: February 28, 2017
-
[autogenerate] [feature] The
EnvironmentContext.configure.target_metadata
parameter
may now be optionally specified as a sequence ofMetaData
objects instead of a singleMetaData
object. The
autogenerate process will process the sequence ofMetaData
objects in order.References: #38
-
[bug] [commands] A
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.References: #369
-
[autogenerate] [bug] [mysql] The
autoincrement=True
flag is now rendered within the
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.References: #413
-
[bug] [postgresql] Fixed bug where Postgresql JSON/JSONB types rendered on SQLAlchemy
1.1 would render the "astext_type" argument which defaults to
theText()
type without the module prefix, similarly to the
issue with ARRAY fixed in #85.References: #411
-
[bug] [postgresql] Fixed bug where Postgresql ARRAY type would not render the import prefix
for the inner type; additionally, user-defined renderers take place
for the inner type as well as the outer type. Pull request courtesy
Paul Brackin.References: #85
-
[autogenerate] [feature] Added a keyword argument
process_revision_directives
to the
command.revision()
API call. This function acts in the
same role as the environment-level
EnvironmentContext.configure.process_revision_directives
,
and allows API use of the
command to drop in an ad-hoc directive process function. This
function can be used among other things to place a complete
MigrationScript
structure in place. -
[feature] [postgresql] Added support for Postgresql EXCLUDE constraints, including the
operation directiveOperations.create_exclude_constraints()
as well as autogenerate render support for theExcludeConstraint
object as present in aTable
. Autogenerate detection for an EXCLUDE
constraint added or removed to/from an existing table is not
implemented as the SQLAlchemy Postgresql dialect does not yet support
reflection of EXCLUDE constraints.Additionally, unknown constraint types now warn when
encountered within an autogenerate action rather than raise.References: #412
-
[bug] [operations] Fixed bug in
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.
0.8.10
0.8.10
Released: January 17, 2017
-
[bug] [versioning] 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
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.References: #406
-
[batch] [bug] 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.References: #402
-
[autogenerate] [bug] [oracle] Adjusted the logic originally added for #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. -
[bug] [versioning] Added a file ignore for Python files of the form
.#<name>.py
,
which are generated by the Emacs editor. Pull request courtesy
Markus Mattes.References: #356
0.8.9
0.8.9
Released: November 28, 2016
-
[autogenerate] [bug] 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.References: #393
-
[batch] [bug] 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.References: #391
-
[autogenerate] [bug] Continued pep8 improvements by adding appropriate whitespace in
the base template for generated migrations. Pull request courtesy
Markus Mattes.References: #393
-
[bug] [revisioning] 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. -
[autogenerate] [bug] Fixed bug where usage of a custom TypeDecorator which returns a
per-dialect type viaTypeDecorator.load_dialect_impl()
that differs
significantly from the default "impl" for the type decorator would fail
to compare correctly during autogenerate.References: #395
-
[autogenerate] [bug] [postgresql] 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.References: #392
-
[bug] [versioning] Fixed bug where the "base" specifier, as in "base:head", could not
be used explicitly when--sql
mode was present.