From b91452270fd76f4284ca0ed3e1c5c2cc7fd15a29 Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Fri, 17 May 2019 17:12:16 -0300 Subject: [PATCH] Revert "HOTFIX: corrige migrate parlamentares 0029" This reverts commit 0ae2b2f8ef5f040cd60baf0a7e70d070dbccf6e9. --- .../migrations/0029_auto_20190517_1531.py | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sapl/parlamentares/migrations/0029_auto_20190517_1531.py b/sapl/parlamentares/migrations/0029_auto_20190517_1531.py index 4f198bf0f..ef24afd91 100644 --- a/sapl/parlamentares/migrations/0029_auto_20190517_1531.py +++ b/sapl/parlamentares/migrations/0029_auto_20190517_1531.py @@ -13,9 +13,22 @@ class Migration(migrations.Migration): operations = [ migrations.RunSQL(""" - update django_content_type set - app_label = 'parlamentares', - model = 'bloco' - where app_label = 'sessao' and model = 'bloco' + update base_autor + set tipo_id = (select id + from base_tipoautor + where content_type_id = (select id + from django_content_type + where app_label = 'parlamentares' and model = 'bloco')) + where tipo_id = (select id + from base_tipoautor + where content_type_id = (select id + from django_content_type + where app_label = 'sessao' and model = 'bloco')); """), + migrations.RunSQL(""" + delete from base_tipoautor + where content_type_id = (select id + from django_content_type + where app_label = 'sessao' and model = 'bloco') + """) ]