summaryrefslogtreecommitdiff
path: root/alembic/runtime
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-09-21 11:28:40 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-09-21 11:28:40 -0400
commit3a984411ccbd1c84140e57c1a4a5e66ba04b739a (patch)
treedfa86e27ed24457e0db35b9e8425e41952cfe77b /alembic/runtime
parentd3676e25beb50ddc821937e4108d1c9535d4951e (diff)
downloadalembic-3a984411ccbd1c84140e57c1a4a5e66ba04b739a.tar.gz
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
Diffstat (limited to 'alembic/runtime')
-rw-r--r--alembic/runtime/migration.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alembic/runtime/migration.py b/alembic/runtime/migration.py
index 352737e..a0b386d 100644
--- a/alembic/runtime/migration.py
+++ b/alembic/runtime/migration.py
@@ -230,7 +230,9 @@ class MigrationContext(object):
"""
if self.as_sql:
start_from_rev = self._start_from_rev
- if start_from_rev is not None and self.script:
+ if start_from_rev == 'base':
+ start_from_rev = None
+ elif start_from_rev is not None and self.script:
start_from_rev = \
self.script.get_revision(start_from_rev).revision