migrations

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT 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/getpup/pupsourcing/cmd/migrate-gen -output migrations

Or add a go generate directive to your code:

//go:generate go run github.com/getpup/pupsourcing/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 GenerateMySQL

func GenerateMySQL(config *Config) error

GenerateMySQL generates a MySQL/MariaDB migration file.

func GeneratePostgres

func GeneratePostgres(config *Config) error

GeneratePostgres generates a PostgreSQL migration file.

func GenerateSQLite

func GenerateSQLite(config *Config) error

GenerateSQLite generates a SQLite 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

	// CheckpointsTable is the name of the projection checkpoints table
	CheckpointsTable 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