~egtann/migrate

ref: f8bba57067c303761315e2916cc06bc61880b2cd migrate/store.go -rw-r--r-- 659 bytes
f8bba570 — Evan Tann update module path 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package migrate

import (
	"database/sql"
)

type Store interface {
	Open() error
	Exec(string, ...interface{}) (sql.Result, error)

	// CreateMetaversionIfNotExists and report the current version.
	CreateMetaVersionIfNotExists() (int, error)
	CreateMetaIfNotExists() error
	CreateMetaCheckpointsIfNotExists() error

	GetMigrations() ([]Migration, error)
	InsertMigration(filename, content, checksum string) error
	UpsertMigration(filename, content, checksum string) error

	GetMetaCheckpoints(string) ([]string, error)
	InsertMetaCheckpoint(filename, content, checksum string, idx int) error
	DeleteMetaCheckpoints() error

	UpgradeToV1([]Migration) error
}