Browse Source

Enable batch migration for SQLite

Matthias Vogelgesang 7 years ago
parent
commit
c6110f0879
1 changed files with 3 additions and 1 deletions
  1. 3 1
      migrations/env.py

+ 3 - 1
migrations/env.py

@@ -41,7 +41,8 @@ def run_migrations_offline():
 
     """
     url = config.get_main_option("sqlalchemy.url")
-    context.configure(url=url)
+    context.configure(url=url,
+                      render_as_batch=True)
 
     with context.begin_transaction():
         context.run_migrations()
@@ -72,6 +73,7 @@ def run_migrations_online():
     connection = engine.connect()
     context.configure(connection=connection,
                       target_metadata=target_metadata,
+                      render_as_batch=True,
                       process_revision_directives=process_revision_directives,
                       **current_app.extensions['migrate'].configure_args)