Inverse les opérations de lecture/ecriture par defaut -> rw
Ce fix corrige le problème des opérations d'écritures dans la bdd master remote, qui marchaient mal, désormais les lignes de logs historiques sont correctement écrites. Il semblerait que django avait du mal à savoir que ces opérations reversion sont bien des opérations d'écriture.
This commit is contained in:
parent
773f39cede
commit
bba144ef14
2 changed files with 4 additions and 4 deletions
|
@ -7,13 +7,13 @@ class DbRouter(object):
|
||||||
"""
|
"""
|
||||||
Attempts to read remote models go to local database.
|
Attempts to read remote models go to local database.
|
||||||
"""
|
"""
|
||||||
return 'default'
|
return 'local'
|
||||||
|
|
||||||
def db_for_write(self, model, **hints):
|
def db_for_write(self, model, **hints):
|
||||||
"""
|
"""
|
||||||
Attempts to write remote models go to the remote database.
|
Attempts to write remote models go to the remote database.
|
||||||
"""
|
"""
|
||||||
return 'master'
|
return 'default'
|
||||||
|
|
||||||
def allow_relation(self, obj1, obj2, **hints):
|
def allow_relation(self, obj1, obj2, **hints):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -51,7 +51,7 @@ TIME_ZONE = 'Europe/Paris'
|
||||||
|
|
||||||
# The storage systems parameters to use
|
# The storage systems parameters to use
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'master': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
'NAME': 're2o',
|
'NAME': 're2o',
|
||||||
'USER': 're2o',
|
'USER': 're2o',
|
||||||
|
@ -62,7 +62,7 @@ DATABASES = {
|
||||||
'COLLATION': 'utf8_general_ci'
|
'COLLATION': 'utf8_general_ci'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'default': {
|
'local': {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
'NAME': 're2o',
|
'NAME': 're2o',
|
||||||
'USER': 're2o_ro',
|
'USER': 're2o_ro',
|
||||||
|
|
Loading…
Reference in a new issue