Commit b1459867 authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch '7-atualizar-numero-de-sequencia-para-0' into 'master'

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

Closes #7

See merge request c3sl/psql-manager!9
parents 10bce2d2 bcec690b
Pipeline #20797 passed with stage
in 1 minute and 23 seconds
......@@ -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"
done
done
......
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