]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
document argparse limitation
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Apr 2022 12:51:36 +0000 (08:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Apr 2022 12:52:15 +0000 (08:52 -0400)
Change-Id: I30257b346c3e3b518d63a80e495d354103063fa9
Fixes: #1020
alembic/autogenerate/api.py
docs/build/tutorial.rst
tests/test_autogen_diffs.py

index 27da02c46fe9a77b0dcab84a229789ff8e4e352d..a5528ff766a3aee5536de293f29bb3d7bbf6bba8 100644 (file)
@@ -370,7 +370,6 @@ class AutogenContext:
         :paramref:`.EnvironmentContext.configure.include_name` parameter.
 
         """
-
         if "schema_name" in parent_names:
             if type_ == "table":
                 table_name = name
index cbf771cd2cdc431eb270b4df8b32904e82cfbdf3..5bfab916e823343d492f920b5310e54fff812a4d 100644 (file)
@@ -580,10 +580,29 @@ to get the current migration::
 
   $ alembic history -r-3:current
 
+.. note::
+
+   As illustrated above, to use ranges that start with a negative number (i.e.
+   a dash), due to a
+   `bug in argparse <https://github.com/python/cpython/issues/53580>`_ , either
+   the syntax ``-r-<base>:<head>``, without any space, must be used as above::
+
+     $ alembic history -r-3:current
+
+   or if using ``--rev-range``, an equals sign must be used::
+
+     $ alembic history --rev-range=-3:current
+
+   Using quotes or escape symbols will not work if there's a space after
+   the argument name.
+
 View all revisions from 1975 to the head::
 
   $ alembic history -r1975ea:
 
+
+
+
 Downgrading
 ===========
 
index 8657aebef5e18e18af1184fa444bd63543fe62a5..ead1a7cd9dfffedda02f6b381b8cc75a969fa7d3 100644 (file)
@@ -825,6 +825,7 @@ class CompareTypeSpecificityTest(TestBase):
         (VARCHAR(30), String(30), False),
         (VARCHAR(30), String(40), True),
         (VARCHAR(30), Integer(), True),
+        (VARCHAR(30), String(), False),
         (Text(), String(255), True),
         # insp + metadata types same number of
         # args but are different; they're different