cobble/models.go

38 lines
680 B
Go
Raw Normal View History

2024-07-11 03:11:14 +00:00
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)
}