-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmanager.go
More file actions
23 lines (22 loc) · 1.02 KB
/
manager.go
File metadata and controls
23 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package migration
// Manager is an interface that describe the common behavior of a migration
// manager.
//
// Any manager is divider in two parts: the `Source` and `Target`. In short, the
// `Source` is the origin of the migrations (eg. SQL files or Go scripts). A
// `Target` is database technology that the migrations will be action on.
//
// Integrating the `Source` and the `Target`, the `Manager` is responsible for
// running migrations with its methods `Migrate`, `Rewind`, `Reset`, `Up` and
// `Down`.
type Manager interface {
Source() Source
Target() Target
MigrationsExecuted() ([]Migration, error)
MigrationsPending() ([]Migration, error)
Migrate(listener Reporter, executionContext interface{}) ([]*Summary, error)
Rewind(listener Reporter, executionContext interface{}) ([]*Summary, error)
Reset(listener Reporter, executionContext interface{}) ([]*Summary, []*Summary, error)
Do(listener Reporter, executionContext interface{}) (*Summary, error)
Undo(listener Reporter, executionContext interface{}) (*Summary, error)
}