Commit bcec690b authored by Gianfranco Harres's avatar Gianfranco Harres Committed by Lucas Fernandes de Oliveira

Resolve "Atualizar número de sequência para 0"

parent 10bce2d2
......@@ -59,7 +59,7 @@ updateSequences() {
for result in "${arr[@]}";do
id=$(echo $result| cut -d'|' -f1 | tr -d '[:space:]')
id_seq=$(echo $result | cut -d"'" -f2)
query="SELECT setval('$id_seq', (SELECT MAX($id) FROM $t));"
query="SELECT setval('$id_seq', COALESCE((SELECT MAX($id) FROM $t)+1,1),false);"
echo $query >> "$tmpWS/seq-trans.sql"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment