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 ¶
- type Store
- func (s *Store) Events(ctx context.Context, connection, schema string, limit int) ([]postgres.MigrationEvent, error)
- func (s *Store) List(ctx context.Context, connection, schema string) ([]postgres.Migration, error)
- func (s *Store) Put(ctx context.Context, m postgres.Migration) (bool, error)
- func (s *Store) Record(ctx context.Context, e postgres.MigrationEvent) error
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 (*Store) Events ¶
func (s *Store) Events(ctx context.Context, connection, schema string, limit int) ([]postgres.MigrationEvent, error)
Events implements postgres.MigrationStore.
func (*Store) List ¶
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).