Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
Migration represents a single database migration
func GetMigrations ¶
func GetMigrations() []Migration
GetMigrations returns all available migrations
type MigrationManager ¶
type MigrationManager struct {
// contains filtered or unexported fields
}
MigrationManager handles database migrations
func NewMigrationManager ¶
func NewMigrationManager(db *sql.DB, dialect Dialect) *MigrationManager
NewMigrationManager creates a new migration manager
func NewMigrationManagerUpTo ¶ added in v0.7.0
func NewMigrationManagerUpTo(db *sql.DB, dialect Dialect, maxVersion int) *MigrationManager
NewMigrationManagerUpTo is a manager that stops at maxVersion, to set up a database as an older release left it (upgrade tests).
func (*MigrationManager) GetCurrentVersion ¶
func (m *MigrationManager) GetCurrentVersion() (int, error)
GetCurrentVersion returns the current migration version (public method)
func (*MigrationManager) Run ¶
func (m *MigrationManager) Run() error
Run executes all pending migrations
Source Files
¶
- 001_initial_schema.go
- 002_server_version.go
- 003_oauth_tokens.go
- 005_large_text_columns.go
- 006_secret_rotation.go
- 007_document_type.go
- 008_sheets.go
- 009_author_token_backfill.go
- 010_cluster_nodes.go
- 011_sheet_epoch.go
- 012_pad_settings.go
- 013_mysql_binary_ids.go
- 014_api_keys.go
- 015_author_privacy.go
- 016_unique_author_mapper.go
- 017_cluster_node_users.go
- 018_accounts.go
- 019_tokens.go
- 020_instance_flags.go
- migrations.go