]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Remove old version notes, prior to version 1.7
authorFederico Caselli <cfederico87@gmail.com>
Sat, 12 Aug 2023 19:40:45 +0000 (21:40 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 12 Aug 2023 19:40:45 +0000 (21:40 +0200)
This also removes some old docs regarding sqlalchemy version prior to version 1

Change-Id: If983df98c07d4a0a6492c151b407b735b74780dc

14 files changed:
alembic/command.py
alembic/context.pyi
alembic/ddl/impl.py
alembic/op.pyi
alembic/operations/base.py
alembic/operations/ops.py
alembic/runtime/environment.py
alembic/runtime/migration.py
alembic/script/write_hooks.py
docs/build/autogenerate.rst
docs/build/batch.rst
docs/build/cookbook.rst
docs/build/front.rst
docs/build/tutorial.rst

index f5e1ee06783d370682114de7ef0ce3319b2a50ae..94c939f7826c84320e8ee38b226730236a1f42db 100644 (file)
@@ -54,9 +54,6 @@ def init(
     :param package: when True, write ``__init__.py`` files into the
      environment location as well as the versions/ location.
 
-     .. versionadded:: 1.2
-
-
     """
 
     if os.access(directory, os.F_OK) and os.listdir(directory):
@@ -625,9 +622,6 @@ def stamp(
      .. note:: this parameter is called "revisions" in the command line
         interface.
 
-     .. versionchanged:: 1.2  The revision may be a single revision or
-        list of revisions when stamping multiple branch heads.
-
     :param sql: use ``--sql`` mode
 
     :param tag: an arbitrary "tag" that can be intercepted by custom
@@ -636,8 +630,6 @@ def stamp(
 
     :param purge: delete all entries in the version table before stamping.
 
-     .. versionadded:: 1.2
-
     """
 
     script = ScriptDirectory.from_config(config)
index eedf7afd8ea8c4ef86a399cb0e7fe6e5de4a0ce4..265d723ce0d285e3c48b333819e26701d918be6b 100644 (file)
@@ -226,9 +226,6 @@ def configure(
      ``connection`` and ``url`` are not passed.
     :param dialect_opts: dictionary of options to be passed to dialect
      constructor.
-
-     .. versionadded:: 1.0.12
-
     :param transactional_ddl: Force the usage of "transactional"
      DDL on or off;
      this otherwise defaults to whether or not the dialect in
@@ -400,8 +397,6 @@ def configure(
             include_name = include_name
         )
 
-     .. versionadded:: 1.5
-
      .. seealso::
 
         :ref:`autogenerate_include_hooks`
index 21371f1a58187d26d340f5f49e2f18e12b4d0aa9..38827092d3d1a33a83d351500d8ea2ae1e6f109b 100644 (file)
@@ -571,8 +571,6 @@ class DefaultImpl(metaclass=ImplMeta):
         """Render a SQL expression that is typically a server default,
         index expression, etc.
 
-        .. versionadded:: 1.0.11
-
         """
 
         compile_kw = {
index dd4703100b20b6c23458fc63f4276d9f6589b3d8..6e143e478bc4724ffeaebf9ffa9835504a37471d 100644 (file)
@@ -181,9 +181,6 @@ def alter_column(
      Set to ``None`` to have the default removed.
     :param comment: optional string text of a new comment to add to the
      column.
-
-     .. versionadded:: 1.0.6
-
     :param new_column_name: Optional; specify a string name here to
      indicate the new name within a column rename operation.
     :param type\_: Optional; a :class:`~sqlalchemy.types.TypeEngine`
@@ -217,9 +214,6 @@ def alter_column(
     :param existing_comment: string text of the existing comment on the
      column to be maintained.  Required on MySQL if the existing comment
      on the column is not being changed.
-
-     .. versionadded:: 1.0.6
-
     :param schema: Optional schema name to operate within.  To control
      quoting of the schema outside of the default behavior, use
      the SQLAlchemy construct
@@ -374,8 +368,6 @@ def batch_alter_table(
      set is undefined.   Therefore it is best to specify the complete
      ordering of all columns for best results.
 
-     .. versionadded:: 1.4.0
-
     .. note:: batch mode requires SQLAlchemy 0.8 or above.
 
     .. seealso::
@@ -827,8 +819,6 @@ def create_table_comment(
 ) -> None:
     """Emit a COMMENT ON operation to set the comment for a table.
 
-    .. versionadded:: 1.0.6
-
     :param table_name: string name of the target table.
     :param comment: string value of the comment being registered against
      the specified table.
@@ -1021,8 +1011,6 @@ def drop_table_comment(
     """Issue a "drop table comment" operation to
     remove an existing comment set on a table.
 
-    .. versionadded:: 1.0.6
-
     :param table_name: string name of the target table.
     :param existing_comment: An optional string value of a comment already
      registered on the specified table.
index 4f33bd0464dc1748befcf13e5f03786ed1c5310f..8df6efd1862398cd77f3371ba5a3d1be31240468 100644 (file)
@@ -350,8 +350,6 @@ class AbstractOperations(util.ModuleClsProxy):
          set is undefined.   Therefore it is best to specify the complete
          ordering of all columns for best results.
 
-         .. versionadded:: 1.4.0
-
         .. note:: batch mode requires SQLAlchemy 0.8 or above.
 
         .. seealso::
@@ -709,9 +707,6 @@ class Operations(AbstractOperations):
              Set to ``None`` to have the default removed.
             :param comment: optional string text of a new comment to add to the
              column.
-
-             .. versionadded:: 1.0.6
-
             :param new_column_name: Optional; specify a string name here to
              indicate the new name within a column rename operation.
             :param type\_: Optional; a :class:`~sqlalchemy.types.TypeEngine`
@@ -745,9 +740,6 @@ class Operations(AbstractOperations):
             :param existing_comment: string text of the existing comment on the
              column to be maintained.  Required on MySQL if the existing comment
              on the column is not being changed.
-
-             .. versionadded:: 1.0.6
-
             :param schema: Optional schema name to operate within.  To control
              quoting of the schema outside of the default behavior, use
              the SQLAlchemy construct
@@ -1223,8 +1215,6 @@ class Operations(AbstractOperations):
         ) -> None:
             """Emit a COMMENT ON operation to set the comment for a table.
 
-            .. versionadded:: 1.0.6
-
             :param table_name: string name of the target table.
             :param comment: string value of the comment being registered against
              the specified table.
@@ -1428,8 +1418,6 @@ class Operations(AbstractOperations):
             """Issue a "drop table comment" operation to
             remove an existing comment set on a table.
 
-            .. versionadded:: 1.0.6
-
             :param table_name: string name of the target table.
             :param existing_comment: An optional string value of a comment already
              registered on the specified table.
@@ -1629,8 +1617,6 @@ class BatchOperations(AbstractOperations):
             :param insert_before: String name of an existing column which this
              column should be placed before, when creating the new table.
 
-             .. versionadded:: 1.4.0
-
             :param insert_after: String name of an existing column which this
              column should be placed after, when creating the new table.  If
              both :paramref:`.BatchOperations.alter_column.insert_before`
@@ -1638,8 +1624,6 @@ class BatchOperations(AbstractOperations):
              omitted, the column is inserted after the last existing column
              in the table.
 
-             .. versionadded:: 1.4.0
-
             .. seealso::
 
                 :meth:`.Operations.alter_column`
@@ -1759,8 +1743,6 @@ class BatchOperations(AbstractOperations):
             """Emit a COMMENT ON operation to set the comment for a table
             using the current batch migration context.
 
-            .. versionadded:: 1.6.0
-
             :param comment: string value of the comment being registered against
              the specified table.
             :param existing_comment: String value of a comment
@@ -1832,8 +1814,6 @@ class BatchOperations(AbstractOperations):
             remove an existing comment set on a table using the current
             batch operations context.
 
-            .. versionadded:: 1.6.0
-
             :param existing_comment: An optional string value of a comment already
              registered on the specified table.
 
index dcf7b6b00cfbbd4966de1521fce5ff3c6f1498bf..4066ac7ec22524628b99e68b51053b0523501351 100644 (file)
@@ -1482,8 +1482,6 @@ class CreateTableCommentOp(AlterTableOp):
     ) -> None:
         """Emit a COMMENT ON operation to set the comment for a table.
 
-        .. versionadded:: 1.0.6
-
         :param table_name: string name of the target table.
         :param comment: string value of the comment being registered against
          the specified table.
@@ -1519,8 +1517,6 @@ class CreateTableCommentOp(AlterTableOp):
         """Emit a COMMENT ON operation to set the comment for a table
         using the current batch migration context.
 
-        .. versionadded:: 1.6.0
-
         :param comment: string value of the comment being registered against
          the specified table.
         :param existing_comment: String value of a comment
@@ -1595,8 +1591,6 @@ class DropTableCommentOp(AlterTableOp):
         """Issue a "drop table comment" operation to
         remove an existing comment set on a table.
 
-        .. versionadded:: 1.0.6
-
         :param table_name: string name of the target table.
         :param existing_comment: An optional string value of a comment already
          registered on the specified table.
@@ -1623,8 +1617,6 @@ class DropTableCommentOp(AlterTableOp):
         remove an existing comment set on a table using the current
         batch operations context.
 
-        .. versionadded:: 1.6.0
-
         :param existing_comment: An optional string value of a comment already
          registered on the specified table.
 
@@ -1873,9 +1865,6 @@ class AlterColumnOp(AlterTableOp):
          Set to ``None`` to have the default removed.
         :param comment: optional string text of a new comment to add to the
          column.
-
-         .. versionadded:: 1.0.6
-
         :param new_column_name: Optional; specify a string name here to
          indicate the new name within a column rename operation.
         :param type\_: Optional; a :class:`~sqlalchemy.types.TypeEngine`
@@ -1909,9 +1898,6 @@ class AlterColumnOp(AlterTableOp):
         :param existing_comment: string text of the existing comment on the
          column to be maintained.  Required on MySQL if the existing comment
          on the column is not being changed.
-
-         .. versionadded:: 1.0.6
-
         :param schema: Optional schema name to operate within.  To control
          quoting of the schema outside of the default behavior, use
          the SQLAlchemy construct
@@ -1972,8 +1958,6 @@ class AlterColumnOp(AlterTableOp):
         :param insert_before: String name of an existing column which this
          column should be placed before, when creating the new table.
 
-         .. versionadded:: 1.4.0
-
         :param insert_after: String name of an existing column which this
          column should be placed after, when creating the new table.  If
          both :paramref:`.BatchOperations.alter_column.insert_before`
@@ -1981,8 +1965,6 @@ class AlterColumnOp(AlterTableOp):
          omitted, the column is inserted after the last existing column
          in the table.
 
-         .. versionadded:: 1.4.0
-
         .. seealso::
 
             :meth:`.Operations.alter_column`
index e5dfa59e33b55e1477378ebc2ade8ce37a24f882..7efa0f02ffb37a2f64b634bb687b4cbdb474e173 100644 (file)
@@ -466,9 +466,6 @@ class EnvironmentContext(util.ModuleClsProxy):
          ``connection`` and ``url`` are not passed.
         :param dialect_opts: dictionary of options to be passed to dialect
          constructor.
-
-         .. versionadded:: 1.0.12
-
         :param transactional_ddl: Force the usage of "transactional"
          DDL on or off;
          this otherwise defaults to whether or not the dialect in
@@ -640,8 +637,6 @@ class EnvironmentContext(util.ModuleClsProxy):
                 include_name = include_name
             )
 
-         .. versionadded:: 1.5
-
          .. seealso::
 
             :ref:`autogenerate_include_hooks`
index 2c10ad599a5233cc5ed494a07ad7a4dbc35772be..76742294e12962b04665fb464d41814067ea9bba 100644 (file)
@@ -320,8 +320,6 @@ class MigrationContext:
             migrations whether or not one of them has an autocommit block.
 
 
-        .. versionadded:: 1.2.0
-
         """
         _in_connection_transaction = self._in_connection_transaction()
 
index 5f53dc2072e0116446a582e06222170d136fa133..6ca1911512fedf26d6efeef6ce0f02e723125595 100644 (file)
@@ -25,8 +25,6 @@ def register(name: str) -> Callable:
 
     See the documentation linked below for an example.
 
-    .. versionadded:: 1.2.0
-
     .. seealso::
 
         :ref:`post_write_hooks_custom`
index 57144432560faba1f4072827d07e1b5cb6893ce2..5f34c0a064efef4971f97efdcefebf94042c1d26 100644 (file)
@@ -142,14 +142,6 @@ Autogenerate can **optionally detect**:
   The type comparison logic is fully extensible as well; see
   :ref:`compare_types` for details.
 
-  .. versionchanged:: 1.4 type comparison code has been reworked such that
-     column types are compared based on their rendered DDL, which should allow
-     the functionality enabled by
-     :paramref:`.EnvironmentContext.configure.compare_type`
-     to be much more accurate, correctly accounting for the behavior of
-     SQLAlchemy "generic" types as well as major arguments specified within
-     types.
-
 * Change of server default.  This will occur if you set
   the :paramref:`.EnvironmentContext.configure.compare_server_default`
   parameter to ``True``, or to a custom callable function.
@@ -393,9 +385,6 @@ rules that include both :class:`~sqlalchemy.schema.MetaData` and reflected
 object, the :paramref:`.EnvironmentContext.configure.include_object` hook
 discussed in the next section is more appropriate.
 
-.. versionadded:: 1.5 added the :paramref:`.EnvironmentContext.configure.include_name`
-    hook.
-
 Omitting Based on Object
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -629,8 +618,6 @@ is set to True::
      database backend sets as a default value without generating false
      positives.
 
-.. versionchanged:: 1.4.0 Added the text and keyword comparison for column types
-
 Alternatively, the :paramref:`.EnvironmentContext.configure.compare_type`
 parameter accepts a callable function which may be used to implement custom type
 comparison logic, for cases such as where special user defined types
@@ -698,10 +685,6 @@ first; if it returns ``None``, then the ``compare_against_backend`` method
 will be used, if present on the metadata type.  If that returns ``None``,
 then a basic check for type equivalence is run.
 
-.. versionadded:: 1.4.0 - added column keyword comparisons and the
-   ``type_synonyms`` property.
-
-
 .. _post_write_hooks:
 
 Applying Post Processing and Python Code Formatters to Generated Revisions
@@ -720,8 +703,6 @@ path to the newly generated file as well as configuration options.
 The post write hooks, when configured,  run against generated revision files
 regardless of whether or not the autogenerate feature was used.
 
-.. versionadded:: 1.2
-
 .. note::
 
     Alembic's post write system is partially inspired by the `pre-commit
index b1a1022e09430e7c9809d3247f5b01f348440b91..a0ed6916bfd543184b71ca5fdc412a7fb6ec7690 100644 (file)
@@ -119,7 +119,7 @@ database that have no identifying name.  On all other backends, the
 target database will always generate some kind of name, if one is not
 given.
 
-The first challenge this represents is that an unnamed constraint can't
+The challenge this represents is that an unnamed constraint can't
 by itself be targeted by the :meth:`.BatchOperations.drop_constraint` method.
 An unnamed FOREIGN KEY constraint is implicit whenever the
 :class:`~sqlalchemy.schema.ForeignKey`
@@ -128,23 +128,15 @@ passing them a name.  Only on SQLite will these constraints remain entirely
 unnamed when they are created on the target database; an automatically generated
 name will be assigned in the case of all other database backends.
 
-A second issue is that SQLAlchemy itself has inconsistent behavior in
-dealing with SQLite constraints as far as names.   Prior to version 1.0,
-SQLAlchemy omits the name of foreign key constraints when reflecting them
-against the SQLite backend.  So even if the target application has gone through
-the steps to apply names to the constraints as stated in the database,
-they still aren't targetable within the batch reflection process prior
-to SQLAlchemy 1.0.
-
 Within the scope of batch mode, this presents the issue that the
 :meth:`.BatchOperations.drop_constraint` method requires a constraint name
 in order to target the correct constraint.
 
 In order to overcome this, the :meth:`.Operations.batch_alter_table` method supports a
 :paramref:`~.Operations.batch_alter_table.naming_convention` argument, so that
-all reflected constraints, including foreign keys that are unnamed, or
-were named but SQLAlchemy isn't loading this name, may be given a name,
-as described in :ref:`autogen_naming_conventions`.   Usage is as follows::
+all reflected constraints, including foreign keys that are unnamed may be
+given a name, as described in :ref:`autogen_naming_conventions`. 
+Usage is as follows::
 
     naming_convention = {
         "fk":
@@ -158,26 +150,6 @@ as described in :ref:`autogen_naming_conventions`.   Usage is as follows::
 Note that the naming convention feature requires at least
 **SQLAlchemy 0.9.4** for support.
 
-Including unnamed UNIQUE constraints
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-A similar, but frustratingly slightly different, issue is that in the
-case of UNIQUE constraints, we again have the issue that SQLite allows
-unnamed UNIQUE constraints to exist on the database, however in this case,
-SQLAlchemy prior to version 1.0 doesn't reflect these constraints at all.
-It does properly reflect named unique constraints with their names, however.
-
-So in this case, the workaround for foreign key names is still not sufficient
-prior to SQLAlchemy 1.0.  If our table includes unnamed unique constraints,
-and we'd like them to be re-created along with the table, we need to include
-them directly, which can be via the
-:paramref:`~.Operations.batch_alter_table.table_args` argument::
-
-    with self.op.batch_alter_table(
-            "bar", table_args=(UniqueConstraint('username'),)
-        ):
-        batch_op.add_column(Column('foo', Integer))
-
 .. _batch_schematype_constraints:
 
 Changing the Type of Boolean, Enum and other implicit CHECK datatypes
index d05bd4071d81c5ef6b59a9242bfa0c3b2fd30b93..0b59de97b14f9ef6d2f94395a25c0abc953047b1 100644 (file)
@@ -1319,24 +1319,16 @@ follows::
                 elem.table_name, schema=elem.schema
             ) as batch_ops:
                 for table_elem in elem.ops:
-                    # work around Alembic issue #753 (fixed in 1.5.0)
-                    if hasattr(table_elem, "column"):
-                        table_elem.column = table_elem.column.copy()
                     batch_ops.invoke(table_elem)
 
         elif hasattr(elem, "ops"):
             stack.extend(elem.ops)
         else:
-            # work around Alembic issue #753 (fixed in 1.5.0)
-            if hasattr(elem, "column"):
-                elem.column = elem.column.copy()
             operations.invoke(elem)
 
 Above, we detect elements that have a collection of operations by looking
 for the ``.ops`` attribute.   A check for :class:`.ModifyTableOps` allows
-us to use a batch context if we are supporting that.   Finally there's a
-workaround for an Alembic issue that exists for SQLAlchemy 1.3.20 and greater
-combined with Alembic older than 1.5.
+us to use a batch context if we are supporting that.
 
 A full example follows.  The overall setup here is copied from the example
 at :func:`.autogenerate.compare_metadata`::
@@ -1400,17 +1392,11 @@ at :func:`.autogenerate.compare_metadata`::
                 elem.table_name, schema=elem.schema
             ) as batch_ops:
                 for table_elem in elem.ops:
-                    # work around Alembic issue #753 (fixed in 1.5.0)
-                    if hasattr(table_elem, "column"):
-                        table_elem.column = table_elem.column.copy()
                     batch_ops.invoke(table_elem)
 
         elif hasattr(elem, "ops"):
             stack.extend(elem.ops)
         else:
-            # work around Alembic issue #753 (fixed in 1.5.0)
-            if hasattr(elem, "column"):
-                elem.column = elem.column.copy()
             operations.invoke(elem)
 
 
index 5ca73e5fbe0cd914ea40e2e5b9fb4059b8991c48..9ec8b7df97ddafbeff762c6d4adba2481f4bdfcf 100644 (file)
@@ -64,10 +64,6 @@ local path is also in ``sys.path``. This allows us to run the ``alembic``
 command line tool from this directory without our project being "installed" in
 that environment.
 
-.. versionchanged:: 1.5.5  Fixed a long-standing issue where the ``alembic``
-   command-line tool would not preserve the default ``sys.path`` of ``.``
-   by implementing ``prepend_sys_path`` option.
-
 As a final step, the `virtualenv activate <https://virtualenv.pypa.io/en/latest/userguide/#activate-script>`_
 tool can be used so that the ``alembic`` command is available without any
 path information, within the context of the current shell::
index 8823a91bfddebbae0090a9461b293dc0bbe344e3..2974768dfb09e9b60abe2f908de9e38b17a3db3b 100644 (file)
@@ -137,7 +137,6 @@ The file generated with the "generic" configuration looks like::
 
     # sys.path path, will be prepended to sys.path if present.
     # defaults to the current working directory.
-    # (new in 1.5.5)
     prepend_sys_path = .
 
     # timezone to use when rendering the date within the migration file