Documentation
¶
Index ¶
- Constants
- Variables
- type Migration
- type MigrationStatus
- type Migrator
- func (m *Migrator) Discover(fsys fs.FS, options ...Option) error
- func (m *Migrator) Init(ctx context.Context) error
- func (s *Migrator) Len() int
- func (s *Migrator) Less(i, j int) bool
- func (m *Migrator) Migrate(ctx context.Context) error
- func (m *Migrator) Rotate(ctx context.Context) error
- func (s *Migrator) Swap(i, j int)
- type Option
- type Rotation
- type Semver
Constants ¶
View Source
const TABLE_MIGRATIONS = "CREATE TABLE IF NOT EXISTS sqle_migrations(" +
"checksum varchar(32) NOT NULL," +
"module varchar(45) NOT NULL," +
"version varchar(45) NOT NULL," +
"name varchar(45) NOT NULL," +
"rank int NOT NULL DEFAULT '0'," +
"migrated_on datetime NOT NULL," +
"execution_time varchar(25) NOT NULL," +
"scripts text NOT NULL," +
"PRIMARY KEY (checksum));"
View Source
const TABLE_ROTATIONS = "CREATE TABLE IF NOT EXISTS sqle_rotations(" +
"checksum varchar(32) NOT NULL," +
"rotated_name varchar(8) NOT NULL," +
"name varchar(45) NOT NULL," +
"rotated_on datetime NOT NULL," +
"execution_time varchar(25) NOT NULL," +
"PRIMARY KEY (checksum, rotated_name));"
Variables ¶
View Source
var ( ErrInvalidScriptName = errors.New("migrate: invalid script name") ErrInvalidRotateRange = errors.New("migrate: invalid rotate range") )
Functions ¶
This section is empty.
Types ¶
type MigrationStatus ¶ added in v1.5.4
type MigrationStatus int
const ( MigrationStatusNew MigrationStatus = iota // new migration, needs to be executed MigrationStatusExecuted // already executed, checksum matches MigrationStatusModified // already executed but checksum changed )
type Migrator ¶
Click to show internal directories.
Click to hide internal directories.