migration

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides database migration operations

func NewService

func NewService(config *domain.Config, logger *slog.Logger) *Service

NewService creates a new migration service

func (*Service) Close

func (s *Service) Close() error

Close implements the MigrationService interface but is a no-op for this service since connections are managed per-operation

func (*Service) Down

func (s *Service) Down(ctx context.Context) error

Down runs one migration down

func (*Service) Drop

func (s *Service) Drop(ctx context.Context) error

Drop drops all tables and schema

func (*Service) Force

func (s *Service) Force(ctx context.Context, version int) error

Force sets the migration version without running migrations

func (*Service) GetMigrationInfo

func (s *Service) GetMigrationInfo(ctx context.Context) (*domain.MigrationInfo, error)

GetMigrationInfo returns information about migration status

func (*Service) IsDirty

func (s *Service) IsDirty(ctx context.Context) (bool, error)

IsDirty checks if the database is in a dirty state

func (*Service) Reset

func (s *Service) Reset(ctx context.Context) error

Reset drops all tables and re-runs all migrations WARNING: This operation is destructive and will delete all data

func (*Service) Steps

func (s *Service) Steps(ctx context.Context, n int) error

Steps runs n migrations up (positive) or down (negative)

func (*Service) Up

func (s *Service) Up(ctx context.Context) error

Up runs all pending migrations

func (*Service) Version

func (s *Service) Version(ctx context.Context) (uint, bool, error)

Version returns the current migration version and dirty state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL