tern_core

Module migration

Source
Expand description

This module contains types and traits related to the migration files.

  • Migration is the abstract representation of what is built from a migration file.
  • QueryBuilder is the recipe for building the query for a migration.
  • MigrationSource is the ability to produce the set of migrations, a MigrationSet, for a particular context in order to be ran in that context.
  • MigrationContext is the core type. It has an associated Executor and it can produce the migrations from source. Combined, it has the full functionality of the migration tool.

Generally these don’t need to be implemented. Their corresponding derive macros can be used instead.

Structs§

  • An AppliedMigration is the information about a migration that completed successfully and it is also a row in the schema history table.
  • Name/version derived from the migration source filename.
  • The Migrations derived from the files in the source directory that need to be applied.
  • A SQL query.

Traits§

  • The “executor” type for the database backend ultimately responsible for issuing migration and schema history queries.
  • A single migration in a migration set.
  • The context in which a migration run occurs.
  • A type that is used to collect a MigrationSet – migrations that are not applied yet – which is used as the input to runner commands.
  • A helper trait for Migration.
  • A type that has a library of “administrative” queries that are needed during a migration run.