migrationtest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package migrationtest builds a test's tables the way an app gets them: from the framework's own migrations, generated by migration.Diff and applied by migration.ApplyPending, in a database from testdb.Open.

It is the one copy of that setup the framework's own suites share. It lives apart from testdb because testdb cannot import migration: the migration package's own tests import testdb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(t testing.TB, sqlDB *sql.DB, dialect db.Dialect, models []model.ModelMeta)

Apply creates a table for each of models in sqlDB, a database from testdb.Open, by applying the migrations Diff generates for them from an empty schema. It fails the test if they do not apply.

Types

This section is empty.

Jump to

Keyboard shortcuts

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