migrationstore

package
v1.164.0 Latest Latest
Warning

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

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

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.

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