EfMigrator Class

Summary

EntityFramework Migrator implentations
Namespace
Cake.EntityFramework.Migrator
Interfaces
Base Types
  • object
graph TD Base0["object"]-->Type Interface0["IEfMigrator"]-.->Type click Interface0 "/Cake.EntityFramework/api/Cake.EntityFramework.Interfaces/IEfMigrator" Interface1["IDisposable"]-.->Type Type["EfMigrator"] class Type type-node

Syntax

public class EfMigrator : IEfMigrator, IDisposable

Constructors

Name Summary
EfMigrator(IEfMigratorBackend, ILogger) Entity Framework Migration
EfMigrator(string, string, string, string, string, ILogger, bool) Entity Framework Migration

Properties

Name Value Summary
Committed bool
Gets a boolean value if the migration was commited successfully
CurrentMigration string
Gets the name of the current migration
Ready bool
Gets a boolean value if the migration is currently ready

Methods

Name Value Summary
Commit() void
Commits the changes to the data store
Dispose() void
Disposes of any resources and unloads te temp AppDomain used for the migrations
GenerateScriptForLatest() string
Generates a script from the data store for the latest version
GenerateScriptForVersion(string) string
Generates a script from the data store to the specific version
GetCurrentMigration() string
Gets the name of the current migration
GetLatestMigration() string
Gets the name of the latest migration
GetLocalMigrations() IEnumerable<string>
Gets all migrations that are defined in the configured migrations assembly.
GetPendingMigrations() IEnumerable<string>
Gets all migrations that are defined in the assembly but haven't been applied to the target database.
GetRemoteMigrations() IEnumerable<string>
Gets all migrations that have been applied to the target database.
HasPendingMigrations() bool
Determines if there are any pending migrations
MigrateTo(string) bool
Migrates the data store to the specific version
MigrateToLatest() bool
Migrates the data store to the lastest version if any
Rollback() void
Rollsback any changes made to the data store