more sql consolidation [CI SKIP]
This commit is contained in:
@@ -604,15 +604,7 @@ func ensureSnapshotRowID(ctx context.Context, dbConn *sqlx.DB, tableName string)
|
||||
return err
|
||||
}
|
||||
}
|
||||
_, err = dbConn.ExecContext(ctx, fmt.Sprintf(
|
||||
`UPDATE %s SET "RowId" = nextval(pg_get_serial_sequence('%s','RowId')) WHERE "RowId" IS NULL`,
|
||||
tableName, tableName,
|
||||
))
|
||||
if err != nil {
|
||||
errText := strings.ToLower(err.Error())
|
||||
if strings.Contains(errText, "pg_get_serial_sequence") || strings.Contains(errText, "sequence") {
|
||||
return nil
|
||||
}
|
||||
if err := db.BackfillSerialColumn(ctx, dbConn, tableName, "RowId"); err != nil {
|
||||
return err
|
||||
}
|
||||
case "sqlite":
|
||||
|
||||
Reference in New Issue
Block a user