mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 12:02:56 +02:00
1 parent
2f13d31ff0
commit
284c0160c3
3 files changed
+20
-16
No files matched your search
+8
@@ -521,6 +521,14 @@ func (engine *Engine) dumpTables(tables []*core.Table, w io.Writer, tp ...core.D
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Hack for postgres
|
||||
if string(dialect.DBType()) == core.POSTGRES && table.AutoIncrColumn() != nil {
|
||||
_, err = io.WriteString(w, "SELECT setval('table_id_seq', COALESCE((SELECT MAX("+table.AutoIncrColumn().Name+") FROM "+dialect.Quote(table.Name)+"), 1), false);\n")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user