New (sqlmigration/sqlmigration.go)

signoz · pkg/sqlmigration/sqlmigration.go · go · MIT
database, tag:embed-classified

Factory for building SQL migration chains from provider factories.

// Source: https://github.com/SigNoz/signoz | License: MIT | Copyright 2020-present SigNoz Inc
// Provided via justclaw.it.com; keep this notice with the code.
package sqlmigration

import (
	"context"

	"github.com/SigNoz/signoz/pkg/factory"
	"github.com/uptrace/bun"
	"github.com/uptrace/bun/migrate"
)

// SQLMigration is the interface for a single migration.
type SQLMigration interface {
	// Register registers the migration with the given migrations. Each migration needs to be registered
	//in a dedicated `*.go` file so that the correct migration semantics can be detected.
	Register(*migrate.Migrations) error

	// Up runs the migration.
	Up(context.Context, *bun.DB) error

	// Down rolls back the migration.
	Down(context.Context, *bun.DB) error
}

var (
	OrgReference                = "or

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key