From 5377359948aef804ce3b4cec313820c8b61c0b21 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 15 Feb 2018 17:31:42 -0200 Subject: [PATCH] =?UTF-8?q?Desliga=20todas=20as=20checagens=20do=20mysql?= =?UTF-8?q?=20na=20migra=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migration.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index aeafd2802..305b9f188 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -344,17 +344,8 @@ def anula_tipos_origem_externa_invalidos(): def uniformiza_banco(): - exec_legado(''' - SELECT replace(@@sql_mode,"STRICT_TRANS_TABLES,","ALLOW_INVALID_DATES"); - ''') - - # ajusta data zero em proposicao - # isso é necessário para poder alterar a tabela a seguir - exec_legado(''' - UPDATE proposicao SET dat_envio = "1800-01-01" WHERE dat_envio = 0; - alter table proposicao modify dat_envio datetime; - UPDATE proposicao SET dat_envio = NULL where dat_envio = "1800-01-01"; - ''') + # desliga todas as checagens do mysql + exec_legado('SET SESSION sql_mode = "";') garante_coluna_no_legado('proposicao', 'num_proposicao int(11) NULL')