refact: Changes required for gorm v2 (#1528)

This commit is contained in:
Jim authored and GitHub committed 2021-09-30 08:47:34 -04:00
1 parent 0d74f8dbc9
commit 136ac00b49
118 files changed
+1127 -580

No files matched your search

+5 -1
View File
@@ -493,7 +493,11 @@ func (c *InitCommand) ParseFlagsAndConfig(args []string) int {
func (c *InitCommand) verifyOplogIsEmpty() error {
const op = "database.(InitCommand).verifyOplogIsEmpty"
r := c.srv.Database.DB().QueryRowContext(c.Context, "select not exists(select 1 from oplog_entry limit 1)")
underlyingDB, err := c.srv.Database.DB()
if err != nil {
return errors.NewDeprecated(errors.Internal, op, "unable to retreive db", errors.WithWrap(err))
}
r := underlyingDB.QueryRowContext(c.Context, "select not exists(select 1 from oplog_entry limit 1)")
if r.Err() != nil {
return r.Err()
}