diff mbox

migrations: Mark '0016_series_project' as non-atomic

Message ID 20170613091547.17117-1-stephen@that.guru
State Accepted
Headers show

Commit Message

Stephen Finucane June 13, 2017, 9:15 a.m. UTC
This should resolve migration issues arising from PostgreSQL's inability
to mix data and schema migrations in a single transaction.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes-bug: #104
Cc: Aaron Conole <aconole@bytheb.org>
Cc: Daniel Axtens <dja@axtens.net>
---
 patchwork/migrations/0016_series_project.py | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Aaron Conole June 13, 2017, 1:45 p.m. UTC | #1
Stephen Finucane <stephen@that.guru> writes:

> This should resolve migration issues arising from PostgreSQL's inability
> to mix data and schema migrations in a single transaction.
>
> Signed-off-by: Stephen Finucane <stephen@that.guru>
> Closes-bug: #104
> Cc: Aaron Conole <aconole@bytheb.org>
> Cc: Daniel Axtens <dja@axtens.net>
> ---

Thanks Stephen!  Resolved the problem.

Acked-by: Aaron Conole <aconole@bytheb.org>
diff mbox

Patch

diff --git a/patchwork/migrations/0016_series_project.py b/patchwork/migrations/0016_series_project.py
index c4874f9..7aea132 100644
--- a/patchwork/migrations/0016_series_project.py
+++ b/patchwork/migrations/0016_series_project.py
@@ -32,6 +32,12 @@  def reverse(apps, schema_editor):
 
 class Migration(migrations.Migration):
 
+    # This is necessary due to a mistake made when writing the migration.
+    # PostgreSQL does not allow mixing of schema and data migrations within the
+    # same transaction. Disabling transactions ensures this doesn't happen.
+    # Refer to bug #104 for more information.
+    atomic = False
+
     dependencies = [
         ('patchwork', '0015_add_series_models'),
     ]