]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- [feature] Added --sql argument to the "revision" command,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 28 Jul 2012 10:29:26 +0000 (06:29 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 28 Jul 2012 10:29:26 +0000 (06:29 -0400)
  for the use case where the "revision_environment"
  config option is being used but SQL access isn't
  desired.

CHANGES
alembic/__init__.py
alembic/command.py

diff --git a/CHANGES b/CHANGES
index 1656c19b1f6e503236f013e72be4ee7a7625a935..7f2220a0d4bc6266fb39b9eb9859bc1950d0223c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,11 +1,16 @@
 0.3.6
 =====
-- Added year, month, day, hour, minute, second
+- [feature] Added year, month, day, hour, minute, second
   variables to file_template.  #59
 
-- Added 'primary' to the list of constraint types
+- [feature] Added 'primary' to the list of constraint types
   recognized for MySQL drop_constraint().
 
+- [feature] Added --sql argument to the "revision" command,
+  for the use case where the "revision_environment"
+  config option is being used but SQL access isn't
+  desired.
+
 0.3.5
 =====
 - [bug] Fixed issue whereby reflected server defaults
index e761d540346a2b344a928e2259ff0682cc40dc1d..38e810773a2349994574238187c1171f4d4dc355 100644 (file)
@@ -1,6 +1,6 @@
 from os import path
 
-__version__ = '0.3.5'
+__version__ = '0.3.6'
 
 package_dir = path.abspath(path.dirname(__file__))
 
index cefd9d95c22f683ba8e4d4c901b4bf20600f40cf..518d624030b365be4a69f922375992f922c92b43 100644 (file)
@@ -9,8 +9,8 @@ def list_templates(config):
     print "Available templates:\n"
     for tempname in os.listdir(config.get_template_directory()):
         readme = os.path.join(
-                        config.get_template_directory(), 
-                        tempname, 
+                        config.get_template_directory(),
+                        tempname,
                         'README')
         synopsis = open(readme).next()
         print "%s - %s" % (tempname, synopsis)
@@ -60,7 +60,7 @@ def init(config, directory, template='generic'):
     util.msg("Please edit configuration/connection/logging "\
             "settings in %r before proceeding." % config_file)
 
-def revision(config, message=None, autogenerate=False):
+def revision(config, message=None, autogenerate=False, sql=False):
     """Create a new revision file."""
 
     script = ScriptDirectory.from_config(config)
@@ -87,8 +87,9 @@ def revision(config, message=None, autogenerate=False):
         with EnvironmentContext(
             config,
             script,
-            fn = retrieve_migrations,
-            template_args = template_args,
+            fn=retrieve_migrations,
+            as_sql=sql,
+            template_args=template_args,
         ):
             script.run_env()
     script.generate_revision(util.rev_id(), message, **template_args)
@@ -199,7 +200,7 @@ def stamp(config, revision, sql=False, tag=None):
         context._update_current_rev(current, dest)
         return []
     with EnvironmentContext(
-        config, 
+        config,
         script,
         fn = do_stamp,
         as_sql = sql,
@@ -210,9 +211,9 @@ def stamp(config, revision, sql=False, tag=None):
 
 def splice(config, parent, child):
     """'splice' two branches, creating a new revision file.
-    
+
     this command isn't implemented right now.
-    
+
     """
     raise NotImplementedError()