Class MigrationBase
The base migration class
Inheritance
Implements
Inherited Members
Namespace: FluentMigrator
Assembly: FluentMigrator.dll
Syntax
public abstract class MigrationBase : IMigration
Properties
| Edit this page View SourceAlter
Gets the starting point for alterations
Declaration
public IAlterExpressionRoot Alter { get; }
Property Value
| Type | Description |
|---|---|
| IAlterExpressionRoot |
ApplicationContext
Gets the arbitrary application context passed to the task runner
Declaration
public object ApplicationContext { get; protected set; }
Property Value
| Type | Description |
|---|---|
| object |
ConnectionString
Gets the connection string passed to the task runner
Declaration
public string ConnectionString { get; protected set; }
Property Value
| Type | Description |
|---|---|
| string |
Create
Gets the starting point for creating database objects
Declaration
public ICreateExpressionRoot Create { get; }
Property Value
| Type | Description |
|---|---|
| ICreateExpressionRoot |
Insert
Gets the starting point for data insertion
Declaration
public IInsertExpressionRoot Insert { get; }
Property Value
| Type | Description |
|---|---|
| IInsertExpressionRoot |
Rename
Gets the starting point for renaming database objects
Declaration
public IRenameExpressionRoot Rename { get; }
Property Value
| Type | Description |
|---|---|
| IRenameExpressionRoot |
Schema
Gets the starting point for schema-rooted expressions
Declaration
public ISchemaExpressionRoot Schema { get; }
Property Value
| Type | Description |
|---|---|
| ISchemaExpressionRoot |
Methods
| Edit this page View SourceDown()
Collects the DOWN migration expressions
Declaration
public abstract void Down()
GetDownExpressions(IMigrationContext)
Collects all Down migration expressions in the context.
Declaration
public virtual void GetDownExpressions(IMigrationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationContext | context | The context to use while collecting the Down migration expressions |
GetUpExpressions(IMigrationContext)
Collects all Up migration expressions in the context.
Declaration
public virtual void GetUpExpressions(IMigrationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationContext | context | The context to use while collecting the Up migration expressions |
IfDatabase(Predicate<string>)
Gets the starting point for database specific expressions
Declaration
public IIfDatabaseExpressionRoot IfDatabase(Predicate<string> databaseTypeFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Predicate<string> | databaseTypeFunc | The lambda that tests if the expression can be applied to the current database |
Returns
| Type | Description |
|---|---|
| IIfDatabaseExpressionRoot | The database specific expression |
IfDatabase(params string[])
Gets the starting point for database specific expressions
Declaration
public IIfDatabaseExpressionRoot IfDatabase(params string[] databaseType)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | databaseType | The supported database types |
Returns
| Type | Description |
|---|---|
| IIfDatabaseExpressionRoot | The database specific expression |
Up()
Collect the UP migration expressions
Declaration
public abstract void Up()