summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-07-28 06:29:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-07-28 06:29:26 -0400
commit8a282878eb15b5d56c63e056d63f67057c07414c (patch)
tree50af74e21ed45cb009f7b1c54678a2eb0a1fac38
parente78e12418f8b251edfcbb864544d89ab226a8294 (diff)
downloadalembic-8a282878eb15b5d56c63e056d63f67057c07414c.tar.gz
- [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.
-rw-r--r--CHANGES9
-rw-r--r--alembic/__init__.py2
-rw-r--r--alembic/command.py17
3 files changed, 17 insertions, 11 deletions
diff --git a/CHANGES b/CHANGES
index 1656c19..7f2220a 100644
--- 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
diff --git a/alembic/__init__.py b/alembic/__init__.py
index e761d54..38e8107 100644
--- a/alembic/__init__.py
+++ b/alembic/__init__.py
@@ -1,6 +1,6 @@
from os import path
-__version__ = '0.3.5'
+__version__ = '0.3.6'
package_dir = path.abspath(path.dirname(__file__))
diff --git a/alembic/command.py b/alembic/command.py
index cefd9d9..518d624 100644
--- a/alembic/command.py
+++ b/alembic/command.py
@@ -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()