From fc333ec82727f9ca7cf00fefb3ae4c6d3569197e Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 7 Apr 2017 12:46:40 -0300 Subject: [PATCH] =?UTF-8?q?Habilita=20pks=20negativas=20na=20migra=C3=A7?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #951 --- sapl/legacy/migration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 5b326897f..99d14f8a7 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -262,7 +262,8 @@ def get_last_value(model): def alter_sequence(model, id): sequence_name = '%s_id_seq' % model._meta.db_table - exec_sql('ALTER SEQUENCE %s RESTART WITH %s;' % (sequence_name, id)) + exec_sql('ALTER SEQUENCE %s RESTART WITH %s MINVALUE %s;' % ( + sequence_name, id, id)) def save_with_id(new, id):