Commits

delegans committed 219d6a0 Draft

Adds revision info message to upgrade and downgrade output

Comments (0)

Files changed (2)

alembic/migration.py

         """
         current_rev = rev = False
         self.impl.start_migrations()
-        for change, prev_rev, rev in self._migrations_fn(
+        for change, prev_rev, rev, doc in self._migrations_fn(
                                         self.get_current_revision(),
                                         self):
             if current_rev is False:
                 current_rev = prev_rev
                 if self.as_sql and not current_rev:
                     self._version.create(self.connection)
-            log.info("Running %s %s -> %s", change.__name__, prev_rev, rev)
+            log.info("Running %s %s -> %s, %s", change.__name__, prev_rev, rev, doc)
             if self.as_sql:
                 self.impl.static_output(
-                        "-- Running %s %s -> %s" %
-                        (change.__name__, prev_rev, rev)
+                        "-- Running %s %s -> %s, %s" %
+                        (change.__name__, prev_rev, rev, doc)
                     )
             change(**kw)
             if not self.impl.transactional_ddl:

alembic/script.py

     def _upgrade_revs(self, destination, current_rev):
         revs = self.iterate_revisions(destination, current_rev)
         return [
-            (script.module.upgrade, script.down_revision, script.revision)
+            (script.module.upgrade, script.down_revision, script.revision, script.doc)
             for script in reversed(list(revs))
             ]
 
     def _downgrade_revs(self, destination, current_rev):
         revs = self.iterate_revisions(current_rev, destination)
         return [
-            (script.module.downgrade, script.revision, script.down_revision)
+            (script.module.downgrade, script.revision, script.down_revision, self.get_revision(script.down_revision).doc)
             for script in revs
             ]