diff --git a/MigrationMap.go b/migration_graph.go similarity index 85% rename from MigrationMap.go rename to migration_graph.go index fab309f..688459e 100644 --- a/MigrationMap.go +++ b/migration_graph.go @@ -5,6 +5,15 @@ import ( "fmt" ) +type MigrationGraph struct { + // Reference to the root of the graph. + Root *Migration + // Name to struct mapping of all migrations part of the graph. + Migrations map[string]Migration + // Mapping of all migrations to their parent, if any. + parentage map[string]*Migration +} + func NewMigrationGraph() MigrationGraph { return MigrationGraph{Migrations: map[string]Migration{}, parentage: map[string]*Migration{}} } diff --git a/models.go b/models.go index 16489ec..dbe86a8 100644 --- a/models.go +++ b/models.go @@ -11,15 +11,6 @@ type Migration struct { Run bool } -type MigrationGraph struct { - // Reference to the root of the graph. - Root *Migration - // Name to struct mapping of all migrations part of the graph. - Migrations map[string]Migration - // Mapping of all migrations to their parent, if any. - parentage map[string]*Migration -} - type DB interface { Execute(sql string) error }