migrations

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package migrations provides SQL migration generation.

To generate migrations, use the migrate-gen command:

go run github.com/eventsalsa/store/cmd/migrate-gen -output migrations

Or add a go generate directive to your code:

//go:generate go run github.com/eventsalsa/store/cmd/migrate-gen -output ../../migrations

Then run:

go generate ./...

Package migrations provides SQL migration generation for event sourcing infrastructure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePostgres

func GeneratePostgres(config *Config) error

GeneratePostgres generates a PostgreSQL migration file.

Types

type Config

type Config struct {
	// OutputFolder is the directory where the migration file will be written
	OutputFolder string

	// OutputFilename is the name of the migration file
	OutputFilename string

	// EventsTable is the name of the events table
	EventsTable string

	// AggregateHeadsTable is the name of the aggregate version tracking table
	AggregateHeadsTable string
}

Config configures migration generation.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration.

Jump to

Keyboard shortcuts

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