add disable_logging option
This commit is contained in:
@@ -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)
|
- `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
|
- 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.
|
- 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
|
- majoy update to documentation
|
||||||
- :ref:`dialect support <dialect-support>` table was added to documentation
|
- :ref:`dialect support <dialect-support>` table was added to documentation
|
||||||
|
|
||||||
.. _backwards-055:
|
.. _backwards-06:
|
||||||
|
|
||||||
**Backward incompatible changes**:
|
**Backward incompatible changes**:
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Given a standard SQLAlchemy table::
|
|||||||
|
|
||||||
.. note::
|
.. 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:
|
.. _table-rename:
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
.. warning::
|
.. 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
|
Download and Development
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class UniqueConstraint(ConstraintChangeset, schema.UniqueConstraint):
|
|||||||
:type table: Table instance
|
:type table: Table instance
|
||||||
:type cols: strings or Column instances
|
:type cols: strings or Column instances
|
||||||
|
|
||||||
.. versionadded:: 0.5.5
|
.. versionadded:: 0.6.0
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__migrate_visit_name__ = 'migrate_unique_constraint'
|
__migrate_visit_name__ = 'migrate_unique_constraint'
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
This module provides an external API to the versioning system.
|
This module provides an external API to the versioning system.
|
||||||
|
|
||||||
.. versionchanged:: 0.6.0
|
.. versionchanged:: 0.6.0
|
||||||
:func:`migrate.versioning.api.test` and schema diff functions \
|
:func:`migrate.versioning.api.test` and schema diff functions
|
||||||
changed order of positional arguments so all accept `url` and `repository`\
|
changed order of positional arguments so all accept `url` and `repository`
|
||||||
as first arguments.
|
as first arguments.
|
||||||
|
|
||||||
.. versionchanged:: 0.5.4
|
.. versionchanged:: 0.5.4
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ def main(argv=None, **kwargs):
|
|||||||
kwargs are default options that can be overriden with passing
|
kwargs are default options that can be overriden with passing
|
||||||
--some_option as command line option
|
--some_option as command line option
|
||||||
|
|
||||||
:param logging: Let migrate configure logging
|
:param disable_logging: Let migrate configure logging
|
||||||
:type logging: bool
|
:type disable_logging: bool
|
||||||
"""
|
"""
|
||||||
argv = argv or list(sys.argv[1:])
|
argv = argv or list(sys.argv[1:])
|
||||||
commands = list(api.__all__)
|
commands = list(api.__all__)
|
||||||
@@ -73,8 +73,17 @@ def main(argv=None, **kwargs):
|
|||||||
""" % '\n\t'.join(commands)
|
""" % '\n\t'.join(commands)
|
||||||
|
|
||||||
parser = PassiveOptionParser(usage=usage)
|
parser = PassiveOptionParser(usage=usage)
|
||||||
parser.add_option("-v", "--verbose", action="store_true", dest="verbose")
|
#parser.add_option("-v", "--verbose", action="store_true", dest="verbose")
|
||||||
parser.add_option("-d", "--debug", action="store_true", dest="debug")
|
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_commands = ['help', '-h', '--help']
|
||||||
HELP = False
|
HELP = False
|
||||||
|
|
||||||
@@ -144,8 +153,12 @@ def main(argv=None, **kwargs):
|
|||||||
# apply overrides
|
# apply overrides
|
||||||
kwargs.update(override_kwargs)
|
kwargs.update(override_kwargs)
|
||||||
|
|
||||||
|
# configure options
|
||||||
|
for key, value in options.__dict__.iteritems():
|
||||||
|
kwargs.setdefault(key, value)
|
||||||
|
|
||||||
# configure logging
|
# configure logging
|
||||||
if asbool(kwargs.pop('logging', True)):
|
if not asbool(kwargs.pop('disable_logging', False)):
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
formatter = logging.Formatter("%(message)s")
|
formatter = logging.Formatter("%(message)s")
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ tag_svn_revision = 1
|
|||||||
tag_build = .dev
|
tag_build = .dev
|
||||||
|
|
||||||
[nosetests]
|
[nosetests]
|
||||||
#pdb = true
|
pdb = true
|
||||||
#pdb-failures = true
|
pdb-failures = true
|
||||||
#stop = true
|
#stop = true
|
||||||
|
|
||||||
[aliases]
|
[aliases]
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ class TestShellCommands(Shell):
|
|||||||
"""Try to shutdown logging output"""
|
"""Try to shutdown logging output"""
|
||||||
repos = self.tmp_repos()
|
repos = self.tmp_repos()
|
||||||
result = self.env.run('migrate create %s repository_name' % 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, '')
|
self.assertEqual(result.stdout, '')
|
||||||
|
|
||||||
# TODO: assert logging messages to 0
|
# TODO: assert logging messages to 0
|
||||||
|
|||||||
Reference in New Issue
Block a user