Browse Source

Habilita pks negativas na migração

Fix #951
pull/997/head
Marcio Mazza 8 years ago
parent
commit
fc333ec827
  1. 3
      sapl/legacy/migration.py

3
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):

Loading…
Cancel
Save