mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-03-16 22:00:22 +00:00
Fixing some transaction handling in MySQL with schema alterations
This commit is contained in:
parent
f51b15942a
commit
55c64af6bd
4 changed files with 6 additions and 8 deletions
|
|
@ -35,9 +35,9 @@ matrix:
|
|||
- python: 3.4
|
||||
env: DJANGO=django==1.7.1 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
|
||||
allow_failures:
|
||||
- DJANGO=django==1.7.1
|
||||
- DJANGO=django==1.7.1 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
|
||||
- DJANGO=django==1.7.1 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
|
||||
- env: DJANGO=django==1.7.1
|
||||
- env: DJANGO=django==1.7.1 DB_ENGINE="django.db.backends.postgresql_psycopg2" DB_NAME="test_project" DB_USER="postgres"
|
||||
- env: DJANGO=django==1.7.1 DB_ENGINE="django.db.backends.mysql" DB_NAME="test_project" DB_USER="travis"
|
||||
fast_finish: true
|
||||
services:
|
||||
- postgresql
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||
import re, abc
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import connection
|
||||
from django.db import connection, transaction
|
||||
from django.db.models import Q
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils import six
|
||||
|
|
@ -181,6 +181,7 @@ class PostgresSearchBackend(SearchBackend):
|
|||
""")
|
||||
return bool(cursor.fetchall())
|
||||
|
||||
@transaction.atomic()
|
||||
def do_install(self):
|
||||
"""Executes the PostgreSQL specific SQL code to install django-watson."""
|
||||
connection.cursor().execute("""
|
||||
|
|
@ -220,6 +221,7 @@ class PostgresSearchBackend(SearchBackend):
|
|||
search_config = self.search_config
|
||||
))
|
||||
|
||||
@transaction.atomic()
|
||||
def do_uninstall(self):
|
||||
"""Executes the PostgreSQL specific SQL code to uninstall django-watson."""
|
||||
connection.cursor().execute("""
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.db import transaction
|
||||
|
||||
from watson.registration import get_backend
|
||||
|
||||
|
|
@ -12,7 +11,6 @@ class Command(NoArgsCommand):
|
|||
|
||||
help = "Creates the database indices needed by django-watson."
|
||||
|
||||
@transaction.atomic()
|
||||
def handle_noargs(self, **options):
|
||||
"""Runs the management command."""
|
||||
verbosity = int(options.get("verbosity", 1))
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.db import transaction
|
||||
|
||||
from watson.registration import get_backend
|
||||
|
||||
|
|
@ -12,7 +11,6 @@ class Command(NoArgsCommand):
|
|||
|
||||
help = "Destroys the database indices needed by django-watson."
|
||||
|
||||
@transaction.atomic()
|
||||
def handle_noargs(self, **options):
|
||||
"""Runs the management command."""
|
||||
verbosity = int(options.get("verbosity", 1))
|
||||
|
|
|
|||
Loading…
Reference in a new issue