cobble/models.go

37 lines
680 B
Go

package main
import (
"database/sql"
)
type MigrationHeaders struct {
Requirements []string
}
type Migration struct {
Path string
Name string
Requires string
Run bool
}
type DatabaseConfiguration struct {
Host string
User string
Password string
DatabaseName string
Port int
}
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 {
Exec(sql string, args ...any) (sql.Result, error)
}