history

package
v1.165.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SET_LOCK_TIMEOUT         = "SET LOCAL lock_timeout = '4s'"
	CREATE_VERSION_SCHEMA    = "CREATE SCHEMA IF NOT EXISTS supabase_migrations"
	CREATE_VERSION_TABLE     = "CREATE TABLE IF NOT EXISTS supabase_migrations.schema_migrations (version text NOT NULL PRIMARY KEY)"
	ADD_STATEMENTS_COLUMN    = "ALTER TABLE supabase_migrations.schema_migrations ADD COLUMN IF NOT EXISTS statements text[]"
	ADD_NAME_COLUMN          = "ALTER TABLE supabase_migrations.schema_migrations ADD COLUMN IF NOT EXISTS name text"
	INSERT_MIGRATION_VERSION = "INSERT INTO supabase_migrations.schema_migrations(version, name, statements) VALUES($1, $2, $3)"
	DELETE_MIGRATION_VERSION = "DELETE FROM supabase_migrations.schema_migrations WHERE version = ANY($1)"
	DELETE_MIGRATION_BEFORE  = "DELETE FROM supabase_migrations.schema_migrations WHERE version <= $1"
	TRUNCATE_VERSION_TABLE   = "TRUNCATE supabase_migrations.schema_migrations"
	SELECT_VERSION_TABLE     = "SELECT * FROM supabase_migrations.schema_migrations"
)

Variables

This section is empty.

Functions

func CreateMigrationTable added in v1.148.9

func CreateMigrationTable(ctx context.Context, conn *pgx.Conn) error

Types

type SchemaMigration added in v1.164.1

type SchemaMigration struct {
	Version    string
	Name       string
	Statements []string
}

func ReadMigrationTable added in v1.164.1

func ReadMigrationTable(ctx context.Context, conn *pgx.Conn) ([]SchemaMigration, error)

Jump to

Keyboard shortcuts

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