Skip to content

Commit 678695e

Browse files
committed
dbutil/upgrades: add dangerous method to run upgrade manually
1 parent 71bf32c commit 678695e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dbutil/upgrades.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ type upgrade struct {
2424
transaction bool
2525
}
2626

27+
func (u *upgrade) DangerouslyRun(ctx context.Context, db *Database) (upgradesTo, compat int, err error) {
28+
return u.upgradesTo, u.compatVersion, u.fn(ctx, db)
29+
}
30+
2731
var ErrUnsupportedDatabaseVersion = errors.New("unsupported database schema version")
2832
var ErrForeignTables = errors.New("the database contains foreign tables")
2933
var ErrNotOwned = errors.New("the database is owned by")

0 commit comments

Comments
 (0)