Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestMigration ¶
Types ¶
type MigrationTester ¶
type MigrationTester interface {
// FilenameTemplateDatabase returns the template for the database filename
// if it's empty create a new one, if not copy this to a temporary file
FilenameTemplateDatabase(*testing.T) string
// InsertData used to insert data in the affected tables of the migration that is being tested
// data will be inserted with the schema as it was before the migration that is being tested
InsertDataBeforeMigrationUp(*testing.T, *sql.DB)
// RunAssertsAfterMigrationUp this function will be called after running the migration is being tested
// and should assert that the data inserted in the function InsertData is persisted properly
RunAssertsAfterMigrationUp(*testing.T, *sql.DB)
// RunAssertsAfterMigrationDown this function will be called after reverting the migration that is being tested
// and should assert that the data inserted in the function InsertData is persisted properly
RunAssertsAfterMigrationDown(*testing.T, *sql.DB)
}
Click to show internal directories.
Click to hide internal directories.