kopia lustrzana https://github.com/wagtail/wagtail
Replace every remaining mention of postgresql_psycopg2.
PostgreSQL search backend were not running because of this since 67b1ddb665 (diff-c2cc727a5e1fca9050dea34af68aa13c)
pull/3940/head
rodzic
780d06215e
commit
9db5b45ec7
|
@ -33,7 +33,7 @@ def pytest_configure(config):
|
|||
pass
|
||||
|
||||
if config.getoption('postgres'):
|
||||
os.environ['DATABASE_ENGINE'] = 'django.db.backends.postgresql_psycopg2'
|
||||
os.environ['DATABASE_ENGINE'] = 'django.db.backends.postgresql'
|
||||
|
||||
# Setup django after processing the pytest arguments so that the env
|
||||
# variables are available in the settings
|
||||
|
|
|
@ -558,7 +558,7 @@ These two files should reside in your project directory (``myproject/myproject/`
|
|||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'myprojectdb',
|
||||
'USER': 'postgres',
|
||||
'PASSWORD': '',
|
||||
|
|
|
@ -47,7 +47,7 @@ def runtests():
|
|||
pass
|
||||
|
||||
if args.postgres:
|
||||
os.environ['DATABASE_ENGINE'] = 'django.db.backends.postgresql_psycopg2'
|
||||
os.environ['DATABASE_ENGINE'] = 'django.db.backends.postgresql'
|
||||
|
||||
if args.elasticsearch:
|
||||
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
|
||||
|
|
|
@ -168,10 +168,10 @@ class Index(object):
|
|||
obj._object_id = force_text(obj.pk)
|
||||
obj._body_ = self.prepare_body(obj)
|
||||
connection = connections[self.db_alias]
|
||||
if connection.pg_version >= 90500: # PostgreSQL >= 9.5
|
||||
self.add_items_upsert(connection, content_type_pk, objs, config)
|
||||
else:
|
||||
self.add_items_update_then_create(content_type_pk, objs, config)
|
||||
# if connection.pg_version >= 90500: # PostgreSQL >= 9.5
|
||||
# self.add_items_upsert(connection, content_type_pk, objs, config)
|
||||
# else:
|
||||
self.add_items_update_then_create(content_type_pk, objs, config)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
|
Ładowanie…
Reference in New Issue