migrationstore

package
v1.169.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package migrationstore keeps the migrations an application database's schema is built from, and their history, in the platform's database (#2404): the appdb_migrations and appdb_migration_events tables. The target database's own ledger records what was applied; these rows are the source of truth it is compared with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the PostgreSQL MigrationStore.

func New

func New(db *sql.DB) *Store

New returns the store over the platform's database.

func (*Store) Events

func (s *Store) Events(ctx context.Context, connection, schema string, limit int) ([]postgres.MigrationEvent, error)

Events implements postgres.MigrationStore.

func (*Store) List

func (s *Store) List(ctx context.Context, connection, schema string) ([]postgres.Migration, error)

List implements postgres.MigrationStore. An empty schema lists every schema of the connection, in schema order.

The schema of an application environment (#2709) holds no migrations of its own: they are kept under the application's schema and applied to each environment's. Such a schema lists its application's migrations under its own name, the schema they are applied to, so status, pending and drift read an environment's schema as they read the application's (#2720).

func (*Store) Put

func (s *Store) Put(ctx context.Context, m postgres.Migration) (bool, error)

Put implements postgres.MigrationStore: it adds the migration, or replaces the one with its version, keeping when that one was first added.

func (*Store) Record

func (s *Store) Record(ctx context.Context, e postgres.MigrationEvent) error

Record implements postgres.MigrationStore.

Jump to

Keyboard shortcuts

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