Class MaintenanceAttribute
Annotates migrations that should always be executed at a specified stage.
Implements
Inherited Members
Namespace: FluentMigrator
Assembly: FluentMigrator.Abstractions.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class MaintenanceAttribute : Attribute, _Attribute
Remarks
Migration annotated with MaintenanceAttribute will be always executed when migrating the database to the latest version. The execution stage in which it would be executed is defined by Stage. The transaction behavior can also be defined with the TransactionBehavior, which if not specified defaults to the default transaction behavior.
Constructors
| Edit this page View SourceMaintenanceAttribute(MigrationStage)
Initializes a new instance of the MaintenanceAttribute class
Declaration
public MaintenanceAttribute(MigrationStage stage)
Parameters
Type | Name | Description |
---|---|---|
MigrationStage | stage | The migration stage when the migration should be applied |
MaintenanceAttribute(MigrationStage, TransactionBehavior)
Initializes a new instance of the MaintenanceAttribute class.
Declaration
public MaintenanceAttribute(MigrationStage stage, TransactionBehavior transactionBehavior)
Parameters
Type | Name | Description |
---|---|---|
MigrationStage | stage | The migration stage when the migration should be applied |
TransactionBehavior | transactionBehavior | The desired transaction behavior |
Properties
| Edit this page View SourceStage
Gets the migration stage when the migration should be applied
Declaration
public MigrationStage Stage { get; }
Property Value
Type | Description |
---|---|
MigrationStage |
TransactionBehavior
Gets the desired transaction behavior
Declaration
public TransactionBehavior TransactionBehavior { get; }
Property Value
Type | Description |
---|---|
TransactionBehavior |