.. changelog::
:version: 1.5.0
- :include_notes_from: unreleased
+ :released: January 18, 2021
+
+ .. change::
+ :tags: usecase, operations
+ :tickets: 730
+
+ Added support for rendering of "identity" elements on
+ :class:`.Column` objects, supported in SQLAlchemy via
+ the :class:`.Identity` element introduced in version 1.4.
+
+ Adding columns with identity is supported on PostgreSQL,
+ MSSQL and Oracle. Changing the identity options or removing
+ it is supported only on PostgreSQL and Oracle.
+
+ .. change::
+ :tags: changed, environment
+
+ To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer
+ assumes that the SQLAlchemy Connection will autocommit an individual
+ operation. This essentially means that for databases that use
+ non-transactional DDL (pysqlite current driver behavior, MySQL), there is
+ still a BEGIN/COMMIT block that will surround each individual migration.
+ Databases that support transactional DDL should continue to have the
+ same flow, either per migration or per-entire run, depending on the
+ value of the :paramref:`.Environment.configure.transaction_per_migration`
+ flag.
+
+
+ .. change::
+ :tags: changed, environment
+
+ A :class:`.CommandError` is raised if a ``sqlalchemy.engine.Engine`` is
+ passed to the :meth:`.MigrationContext.configure` method instead of a
+ ``sqlalchemy.engine.Connection`` object. Previously, this would be a
+ warning only.
+
+ .. change::
+ :tags: bug, operations
+ :tickets: 753
+
+ Modified the ``add_column()`` operation such that the ``Column`` object in
+ use is shallow copied to a new instance if that ``Column`` is already
+ attached to a ``table()`` or ``Table``. This accommodates for the change
+ made in SQLAlchemy issue #5618 which prohibits a ``Column`` from being
+ associated with multiple ``table()`` objects. This resumes support for
+ using a ``Column`` inside of an Alembic operation that already refers to a
+ parent ``table()`` or ``Table`` as well as allows operation objects just
+ autogenerated to work.
+
+ .. change::
+ :tags: feature, autogenerate
+ :tickets: 650
+
+ Added new hook :paramref:`.EnvironmentContext.configure.include_name`,
+ which complements the
+ :paramref:`.EnvironmentContext.configure.include_object` hook by providing
+ a means of preventing objects of a certain name from being autogenerated
+ **before** the SQLAlchemy reflection process takes place, and notably
+ includes explicit support for passing each schema name when
+ :paramref:`.EnvironmentContext.configure.include_schemas` is set to True.
+ This is most important especially for enviroments that make use of
+ :paramref:`.EnvironmentContext.configure.include_schemas` where schemas are
+ actually databases (e.g. MySQL) in order to prevent reflection sweeps of
+ the entire server.
+
+ .. seealso::
+
+ :ref:`autogenerate_include_hooks` - new documentation section
+
+ .. change::
+ :tags: removed, autogenerate
+
+ The long deprecated
+ :paramref:`.EnvironmentContext.configure.include_symbol` hook is removed.
+ The :paramref:`.EnvironmentContext.configure.include_object`
+ and :paramref:`.EnvironmentContext.configure.include_name`
+ hooks both achieve the goals of this hook.
+
+
+ .. change::
+ :tags: bug, autogenerate
+ :tickets: 721
+
+ Added rendering for the ``Table.prefixes`` element to autogenerate so that
+ the rendered Python code includes these directives. Pull request courtesy
+ Rodrigo Ce Moretto.
+
+ .. change::
+ :tags: bug, batch
+ :tickets: 761
+
+ Added missing "create comment" feature for columns that are altered in
+ batch migrations.
+
+
+ .. change::
+ :tags: changed
+ :tickets: 748
+
+ Alembic 1.5.0 now supports **Python 2.7 and Python 3.6 and above**, as well
+ as **SQLAlchemy 1.3.0 and above**. Support is removed for Python 3
+ versions prior to 3.6 and SQLAlchemy versions prior to the 1.3 series.
+
+ .. change::
+ :tags: bug, batch
+ :tickets: 773
+
+ Made an adjustment to the PostgreSQL dialect to allow it to work more
+ effectively in batch mode, where a datatype like Boolean or non-native Enum
+ that may have embedded rules to generate CHECK constraints will be more
+ correctly handled in that these constraints usually will not have been
+ generated on the PostgreSQL backend; previously it would inadvertently
+ assume they existed unconditionally in a special PG-only "drop constraint"
+ step.
+
+
+ .. change::
+ :tags: feature, versioning
+ :tickets: 757
+
+ The revision tree is now checked for cycles and loops between revision
+ files when the revision environment is loaded up. Scenarios such as a
+ revision pointing to itself, or a revision that can reach itself via a
+ loop, are handled and will raise the :class:`.CycleDetected` exception when
+ the environment is loaded (expressed from the Alembic commandline as a
+ failure message and nonzero return code). Previously, these situations were
+ silently ignored up front, and the behavior of revision traversal would
+ either be silently incorrect, or would produce errors such as
+ :class:`.RangeNotAncestorError`. Pull request courtesy Koichiro Den.
+
+
+ .. change::
+ :tags: usecase, commands
+
+ Add ``__main__.py`` file to alembic package to support invocation
+ with ``python -m alembic``.
+
+ .. change::
+ :tags: removed, commands
+
+ Removed deprecated ``--head_only`` option to the ``alembic current``
+ command
+
+ .. change::
+ :tags: removed, operations
+
+ Removed legacy parameter names from operations, these have been emitting
+ warnings since version 0.8. In the case that legacy version files have not
+ yet been updated, these can be modified directly in order to maintain
+ compatibility:
+
+ * :meth:`.Operations.drop_constraint` - "type" (use "type_") and "name"
+ (use "constraint_name")
+
+ * :meth:`.Operations.create_primary_key` - "cols" (use "columns") and
+ "name" (use "constraint_name")
+
+ * :meth:`.Operations.create_unique_constraint` - "name" (use
+ "constraint_name"), "source" (use "table_name") and "local_cols" (use
+ "columns")
+
+ * :meth:`.Operations.batch_create_unique_constraint` - "name" (use
+ "constraint_name")
+
+ * :meth:`.Operations.create_foreign_key` - "name" (use "constraint_name"),
+ "source" (use "source_table"), "referent" (use "referent_table")
+
+ * :meth:`.Operations.batch_create_foreign_key` - "name" (use
+ "constraint_name"), "referent" (use "referent_table")
+
+ * :meth:`.Operations.create_check_constraint` - "name" (use
+ "constraint_name"), "source" (use "table_name")
+
+ * :meth:`.Operations.batch_create_check_constraint` - "name" (use
+ "constraint_name")
+
+ * :meth:`.Operations.create_index` - "name" (use "index_name")
+
+ * :meth:`.Operations.drop_index` - "name" (use "index_name"), "tablename"
+ (use "table_name")
+
+ * :meth:`.Operations.batch_drop_index` - "name" (use "index_name"),
+
+ * :meth:`.Operations.create_table` - "name" (use "table_name")
+
+ * :meth:`.Operations.drop_table` - "name" (use "table_name")
+
+ * :meth:`.Operations.alter_column` - "name" (use "new_column_name")
+
+
.. changelog::
:version: 1.4.3
+++ /dev/null
-.. change::
- :tags: removed, commands
-
- Removed deprecated ``--head_only`` option to the ``alembic current``
- command
-
-.. change::
- :tags: removed, operations
-
- Removed legacy parameter names from operations, these have been emitting
- warnings since version 0.8. In the case that legacy version files have not
- yet been updated, these can be modified directly in order to maintain
- compatibility:
-
- * :meth:`.Operations.drop_constraint` - "type" (use "type_") and "name"
- (use "constraint_name")
-
- * :meth:`.Operations.create_primary_key` - "cols" (use "columns") and
- "name" (use "constraint_name")
-
- * :meth:`.Operations.create_unique_constraint` - "name" (use
- "constraint_name"), "source" (use "table_name") and "local_cols" (use
- "columns")
-
- * :meth:`.Operations.batch_create_unique_constraint` - "name" (use
- "constraint_name")
-
- * :meth:`.Operations.create_foreign_key` - "name" (use "constraint_name"),
- "source" (use "source_table"), "referent" (use "referent_table")
-
- * :meth:`.Operations.batch_create_foreign_key` - "name" (use
- "constraint_name"), "referent" (use "referent_table")
-
- * :meth:`.Operations.create_check_constraint` - "name" (use
- "constraint_name"), "source" (use "table_name")
-
- * :meth:`.Operations.batch_create_check_constraint` - "name" (use
- "constraint_name")
-
- * :meth:`.Operations.create_index` - "name" (use "index_name")
-
- * :meth:`.Operations.drop_index` - "name" (use "index_name"), "tablename"
- (use "table_name")
-
- * :meth:`.Operations.batch_drop_index` - "name" (use "index_name"),
-
- * :meth:`.Operations.create_table` - "name" (use "table_name")
-
- * :meth:`.Operations.drop_table` - "name" (use "table_name")
-
- * :meth:`.Operations.alter_column` - "name" (use "new_column_name")
-
-