2017-06-07 22:54:37 +02:00
|
|
|
package migrations
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2017-07-23 14:21:03 +02:00
|
|
|
|
2017-07-24 17:42:25 +02:00
|
|
|
"github.com/restic/restic/internal/restic"
|
2017-06-07 22:54:37 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// Migration implements a data migration.
|
|
|
|
type Migration interface {
|
2022-09-03 11:49:31 +02:00
|
|
|
// Check returns true if the migration can be applied to a repo. If the option is not applicable it can return a specific reason.
|
|
|
|
Check(context.Context, restic.Repository) (bool, string, error)
|
2017-06-07 22:54:37 +02:00
|
|
|
|
2022-06-04 23:45:00 +02:00
|
|
|
RepoCheck() bool
|
2022-05-01 20:16:49 +02:00
|
|
|
|
2017-06-07 22:54:37 +02: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
|
|
|
|
}
|