Database access in data migrations defaults to the 'default' database. Force it to the user selected database instead.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@ from django.db import models, migrations
|
||||
def make_existing_documents_not_stubs(apps, schema_editor):
|
||||
Document = apps.get_model('documents', 'Document')
|
||||
|
||||
for document in Document.objects.all():
|
||||
for document in Document.objects.using(schema_editor.connection.alias).all():
|
||||
document.is_stub = False
|
||||
document.save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user