2017-06-07 20:54:37 +00:00
|
|
|
package migrations
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2017-07-23 12:21:03 +00:00
|
|
|
|
2017-07-24 15:42:25 +00:00
|
|
|
"github.com/restic/restic/internal/restic"
|
2017-06-07 20:54:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Migration implements a data migration.
|
|
|
|
type Migration interface {
|
|
|
|
// Check returns true if the migration can be applied to a repo.
|
|
|
|
Check(context.Context, restic.Repository) (bool, error)
|
|
|
|
|
2022-06-04 21:45:00 +00:00
|
|
|
RepoCheck() bool
|
2022-05-01 18:16:49 +00:00
|
|
|
|
2017-06-07 20:54:37 +00:00
|
|
|
// Apply runs the migration.
|
|
|
|
Apply(context.Context, restic.Repository) error
|
|
|
|
|
|
|
|
// Name returns a short name.
|
|
|
|
Name() string
|
|
|
|
|
|
|
|
// Descr returns a description what the migration does.
|
|
|
|
Desc() string
|
|
|
|
}
|