Bryce Lohr  committed 93b0e45

Updated multidb template's to be closer to generic's. Fixed invalid reference to options, fixed SQL comment to be MySQL-safe

  • Participants
  • Parent commits 3a8e4e8

Comments (0)

Files changed (1)

File alembic/templates/multidb/

+from __future__ import with_statement
 from alembic import context
 from sqlalchemy import engine_from_config, pool
+from logging.config import fileConfig
 import re
 import sys
-import logging
+# this is the Alembic Config object, which provides
+# access to the values within the .ini file in use.
+config = context.config
+# Interpret the config file for Python logging. 
+# This line sets up loggers basically.
 # gather section names referring to different 
 # databases.  These are named "engine1", "engine2"
 # in the sample .ini file.
-db_names = options.get_main_option('databases')
+db_names = config.get_main_option('databases')
 # add your model's MetaData objects here
 # for 'autogenerate' support.  These must be set 
 target_metadata = {}
+# other values from the config, defined by the needs of,
+# can be acquired:
+# my_important_option = config.get_main_option("my_important_option")
+# ... etc.
 def run_migrations_offline():
     """Run migrations in 'offline' mode.
-            context.execute("--running migrations for engine %s" % name)
+            context.execute("-- running migrations for engine %s" % name)
         if USE_TWOPHASE: