]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- changelog
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Apr 2013 20:42:29 +0000 (16:42 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Apr 2013 20:42:29 +0000 (16:42 -0400)
- test for #76
- don't need output_encoding explicit here

alembic/environment.py
alembic/migration.py
docs/build/changelog.rst
tests/test_version_table.py

index d6b47dfc8fb5c9f4f6894b7f739d90c3e5274cfd..e256690ef843b2ecb8f0f5f86ae1dcd9a7756426 100644 (file)
@@ -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:
index 60f22a34422df2ca25aa341c5ed3c0ebdbde6363..b336ec9af464d8eeca94675cd80fc1b8a91a8caf 100644 (file)
@@ -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)
index a294bb90ccdf7eb4902a936d9d50901f98a4c811..4bc3d51f28335b649993981cd0f0e625eb359a38 100644 (file)
@@ -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
index 0343cb1c6b0491593999e89023edfe9aece34ee6..3a0a54d92707990dcab985330ea15241b7503aa9 100644 (file)
@@ -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'})