diff --git a/docs/changelog.rst b/docs/changelog.rst index 09b56ae..7b20ac1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,7 +1,7 @@ -0.5.5 +0.6.0 ----- -- use Python logging for output, can be shut down by passing ``logging=False`` to :func:`migrate.versioning.shell.main` +- use Python logging for output, can be shut down by passing ``--disable_logging`` to :func:`migrate.versioning.shell.main` - `url` parameter can also be an :class:`Engine` instance (this usage is discouraged though sometimes necessary) - added support for SQLAlchemy 0.6 (missing oracle and firebird) by Michael Bayer - alter, create, drop column / rename table / rename index constructs now accept `alter_metadata` parameter. If True, it will modify Column/Table objects according to changes. Otherwise, everything will be untouched. @@ -20,7 +20,7 @@ - majoy update to documentation - :ref:`dialect support <dialect-support>` table was added to documentation -.. _backwards-055: +.. _backwards-06: **Backward incompatible changes**: diff --git a/docs/changeset.rst b/docs/changeset.rst index 2612e7c..47e6908 100644 --- a/docs/changeset.rst +++ b/docs/changeset.rst @@ -72,7 +72,7 @@ Given a standard SQLAlchemy table:: .. note:: - Since version ``0.5.5`` you can pass primary_key_name, index_name and unique_name to column.create method to issue ALTER TABLE ADD CONSTRAINT after changing the column. Note for multi columns constraints and other advanced configuration, check :ref:`constraint tutorial <constraint-tutorial>`. + Since version ``0.6.0`` you can pass primary_key_name, index_name and unique_name to column.create method to issue ALTER TABLE ADD CONSTRAINT after changing the column. Note for multi columns constraints and other advanced configuration, check :ref:`constraint tutorial <constraint-tutorial>`. .. _table-rename: diff --git a/docs/index.rst b/docs/index.rst index feb869c..ec91a9b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,7 +29,7 @@ .. warning:: - Version **0.5.5** breaks backward compatability, please read :ref:`changelog <backwards-055>` for more info. + Version **0.6.0** breaks backward compatability, please read :ref:`changelog <backwards-06>` for more info. Download and Development diff --git a/migrate/changeset/constraint.py b/migrate/changeset/constraint.py index 72251f5..3c20d3f 100644 --- a/migrate/changeset/constraint.py +++ b/migrate/changeset/constraint.py @@ -173,7 +173,7 @@ class UniqueConstraint(ConstraintChangeset, schema.UniqueConstraint): :type table: Table instance :type cols: strings or Column instances - .. versionadded:: 0.5.5 + .. versionadded:: 0.6.0 """ __migrate_visit_name__ = 'migrate_unique_constraint' diff --git a/migrate/versioning/api.py b/migrate/versioning/api.py index 5964d18..1618d65 100644 --- a/migrate/versioning/api.py +++ b/migrate/versioning/api.py @@ -2,9 +2,9 @@ This module provides an external API to the versioning system. .. versionchanged:: 0.6.0 - :func:`migrate.versioning.api.test` and schema diff functions \ - changed order of positional arguments so all accept `url` and `repository`\ - as first arguments. + :func:`migrate.versioning.api.test` and schema diff functions + changed order of positional arguments so all accept `url` and `repository` + as first arguments. .. versionchanged:: 0.5.4 ``--preview_sql`` displays source file when using SQL scripts. diff --git a/migrate/versioning/shell.py b/migrate/versioning/shell.py index b99cc49..b9b6f86 100644 --- a/migrate/versioning/shell.py +++ b/migrate/versioning/shell.py @@ -57,8 +57,8 @@ def main(argv=None, **kwargs): kwargs are default options that can be overriden with passing --some_option as command line option - :param logging: Let migrate configure logging - :type logging: bool + :param disable_logging: Let migrate configure logging + :type disable_logging: bool """ argv = argv or list(sys.argv[1:]) commands = list(api.__all__) @@ -73,8 +73,17 @@ def main(argv=None, **kwargs): """ % '\n\t'.join(commands) parser = PassiveOptionParser(usage=usage) - parser.add_option("-v", "--verbose", action="store_true", dest="verbose") - parser.add_option("-d", "--debug", action="store_true", dest="debug") + #parser.add_option("-v", "--verbose", action="store_true", dest="verbose") + parser.add_option("-d", "--debug", + action="store_true", + dest="debug", + default=False, + help="Shortcut to turn on DEBUG mode for logging") + parser.add_option("-q", "--disable_logging", + action="store_true", + dest="disable_logging", + default=False, + help="Use this option to disable logging configuration") help_commands = ['help', '-h', '--help'] HELP = False @@ -144,8 +153,12 @@ def main(argv=None, **kwargs): # apply overrides kwargs.update(override_kwargs) + # configure options + for key, value in options.__dict__.iteritems(): + kwargs.setdefault(key, value) + # configure logging - if asbool(kwargs.pop('logging', True)): + if not asbool(kwargs.pop('disable_logging', False)): logger = logging.getLogger() logger.setLevel(logging.INFO) formatter = logging.Formatter("%(message)s") diff --git a/setup.cfg b/setup.cfg index 05ad7a5..1229d67 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,8 +7,8 @@ tag_svn_revision = 1 tag_build = .dev [nosetests] -#pdb = true -#pdb-failures = true +pdb = true +pdb-failures = true #stop = true [aliases] diff --git a/test/versioning/test_shell.py b/test/versioning/test_shell.py index 0cb0b1a..1a35ce9 100644 --- a/test/versioning/test_shell.py +++ b/test/versioning/test_shell.py @@ -35,7 +35,9 @@ class TestShellCommands(Shell): """Try to shutdown logging output""" repos = self.tmp_repos() result = self.env.run('migrate create %s repository_name' % repos) - result = self.env.run('migrate version %s --logging=False' % repos) + result = self.env.run('migrate version %s --disable_logging' % repos) + self.assertEqual(result.stdout, '') + result = self.env.run('migrate version %s -q' % repos) self.assertEqual(result.stdout, '') # TODO: assert logging messages to 0