From: Mike Bayer Date: Thu, 4 Apr 2013 20:42:29 +0000 (-0400) Subject: - changelog X-Git-Tag: rel_0_5_0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eb233da276e8859f5d8c15f673df16ee2ac8342;p=thirdparty%2Fsqlalchemy%2Falembic.git - changelog - test for #76 - don't need output_encoding explicit here --- diff --git a/alembic/environment.py b/alembic/environment.py index d6b47dfc..e256690e 100644 --- a/alembic/environment.py +++ b/alembic/environment.py @@ -204,7 +204,6 @@ class EnvironmentContext(object): dialect_name=None, transactional_ddl=None, output_buffer=None, - output_encoding=None, starting_rev=None, tag=None, template_args=None, @@ -291,6 +290,10 @@ class EnvironmentContext(object): is present in the alembic.ini file. New in 0.3.3. :param version_table: The name of the Alembic version table. The default is ``'alembic_version'``. + :param version_table_schema: Optional schema to place version + table within. + + .. versionadded:: 0.5.0 Parameters specific to the autogenerate feature, when ``alembic revision`` is run with the ``--autogenerate`` feature: @@ -477,8 +480,6 @@ class EnvironmentContext(object): opts["output_buffer"] = output_buffer elif self.config.output_buffer is not None: opts["output_buffer"] = self.config.output_buffer - if output_encoding is not None: - opts["output_encoding"] = output_encoding if starting_rev: opts['starting_rev'] = starting_rev if tag: diff --git a/alembic/migration.py b/alembic/migration.py index 60f22a34..b336ec9a 100644 --- a/alembic/migration.py +++ b/alembic/migration.py @@ -59,8 +59,8 @@ class MigrationContext(object): self.dialect = dialect self.script = opts.get('script') - as_sql=opts.get('as_sql', False) - transactional_ddl=opts.get("transactional_ddl") + as_sql = opts.get('as_sql', False) + transactional_ddl = opts.get("transactional_ddl") if as_sql: self.connection = self._stdout_connection(connection) diff --git a/docs/build/changelog.rst b/docs/build/changelog.rst index a294bb90..4bc3d51f 100644 --- a/docs/build/changelog.rst +++ b/docs/build/changelog.rst @@ -6,6 +6,17 @@ Changelog .. changelog:: :version: 0.5.0 + .. change:: + :tags: feature + :tickets: 76 + :pullreq: 24 + + Added ``version_table_schema`` argument + to :meth:`.EnvironmentContext.configure`, + complements the ``version_table`` argument to + set an optional remote schema for the version + table. Courtesy Christian Blume. + .. change:: :tags: bug, postgresql :tickets: 32 diff --git a/tests/test_version_table.py b/tests/test_version_table.py index 0343cb1c..3a0a54d9 100644 --- a/tests/test_version_table.py +++ b/tests/test_version_table.py @@ -47,6 +47,11 @@ class TestMigrationContext(unittest.TestCase): opts={'version_table': 'explicit'}) self.assertEqual(context._version.name, 'explicit') + def test_config_explicit_version_table_schema(self): + context = self.make_one(dialect_name='sqlite', + opts={'version_table_schema': 'explicit'}) + self.assertEqual(context._version.schema, 'explicit') + def test_get_current_revision_creates_version_table(self): context = self.make_one(connection=self.connection, opts={'version_table': 'version_table'})