View Source
Class AsyncMigrationBase
Provides a base class to all migrations.
Assembly: Umbraco.Infrastructure.dll
Syntax
public abstract class AsyncMigrationBase : IDiscoverable
Constructors
View Source
AsyncMigrationBase(IMigrationContext)
Declaration
protected AsyncMigrationBase(IMigrationContext context)
Parameters
Properties
View Source
Alter
Builds an Alter expression.
Declaration
public IAlterBuilder Alter { get; }
Property Value
View Source
Context
Gets the migration context.
Declaration
protected IMigrationContext Context { get; }
Property Value
View Source
Create
Builds a Create expression.
Declaration
public ICreateBuilder Create { get; }
Property Value
View Source
Database
Gets the database instance.
Declaration
protected IUmbracoDatabase Database { get; }
Property Value
View Source
DatabaseType
Declaration
protected DatabaseType DatabaseType { get; }
Property Value
| Type |
Description |
| DatabaseType |
|
View Source
Delete
Builds a Delete expression.
Declaration
public IDeleteBuilder Delete { get; }
Property Value
View Source
Execute
Builds an Execute expression.
Declaration
public IExecuteBuilder Execute { get; }
Property Value
View Source
Insert
Builds an Insert expression.
Declaration
public IInsertBuilder Insert { get; }
Property Value
View Source
InvalidateBackofficeUserAccess
If this is set to true, all back-office client tokens will be revoked upon successful completion of the migration.
Declaration
public bool InvalidateBackofficeUserAccess { get; set; }
Property Value
View Source
Logger
Declaration
protected ILogger Logger { get; }
Property Value
View Source
RebuildCache
If this is set to true, the published cache will be rebuild upon successful completion of the migration.
Declaration
public bool RebuildCache { get; set; }
Property Value
View Source
Rename
Builds a Rename expression.
Declaration
public IRenameBuilder Rename { get; }
Property Value
View Source
SqlSyntax
Declaration
protected ISqlSyntaxProvider SqlSyntax { get; }
Property Value
View Source
Update
Builds an Update expression.
Declaration
public IUpdateBuilder Update { get; }
Property Value
Methods
View Source
AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, string)
Declaration
protected void AddColumnIfNotExists<T>(IEnumerable<ColumnInfo> columns, string columnName)
Parameters
| Type |
Name |
Description |
| IEnumerable<ColumnInfo> |
columns |
|
| string |
columnName |
|
Type Parameters
View Source
AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, string, string)
Declaration
protected void AddColumnIfNotExists<T>(IEnumerable<ColumnInfo> columns, string tableName, string columnName)
Parameters
| Type |
Name |
Description |
| IEnumerable<ColumnInfo> |
columns |
|
| string |
tableName |
|
| string |
columnName |
|
Type Parameters
View Source
AddColumn<T>(string)
Declaration
protected void AddColumn<T>(string columnName)
Parameters
| Type |
Name |
Description |
| string |
columnName |
|
Type Parameters
View Source
AddColumn<T>(string, out IEnumerable<string>)
Declaration
protected void AddColumn<T>(string columnName, out IEnumerable<string> sqls)
Parameters
| Type |
Name |
Description |
| string |
columnName |
|
| IEnumerable<string> |
sqls |
|
Type Parameters
View Source
AddColumn<T>(string, string)
Declaration
protected void AddColumn<T>(string tableName, string columnName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
columnName |
|
Type Parameters
View Source
AddColumn<T>(string, string, out IEnumerable<string>)
Declaration
protected void AddColumn<T>(string tableName, string columnName, out IEnumerable<string> sqls)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
columnName |
|
| IEnumerable<string> |
sqls |
|
Type Parameters
View Source
AlterColumn<T>(string, string)
Declaration
protected void AlterColumn<T>(string tableName, string columnName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
columnName |
|
Type Parameters
View Source
ColumnExists(string, string)
Declaration
protected bool ColumnExists(string tableName, string columnName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
columnName |
|
Returns
View Source
ColumnType(string, string)
Declaration
protected string? ColumnType(string tableName, string columnName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
columnName |
|
Returns
View Source
CreateIndex<T>(string)
Declaration
protected void CreateIndex<T>(string toCreate)
Parameters
| Type |
Name |
Description |
| string |
toCreate |
|
Type Parameters
View Source
DeleteIndex<T>(string)
Declaration
protected void DeleteIndex<T>(string toDelete)
Parameters
| Type |
Name |
Description |
| string |
toDelete |
|
Type Parameters
View Source
IndexExists(string)
Declaration
protected bool IndexExists(string indexName)
Parameters
| Type |
Name |
Description |
| string |
indexName |
|
Returns
View Source
MigrateAsync()
Declaration
protected abstract Task MigrateAsync()
Returns
View Source
PrimaryKeyExists(string, string)
Declaration
protected bool PrimaryKeyExists(string tableName, string primaryKeyName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
primaryKeyName |
|
Returns
View Source
ReplaceColumn<T>(string, string, string)
Declaration
protected void ReplaceColumn<T>(string tableName, string currentName, string newName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
| string |
currentName |
|
| string |
newName |
|
Type Parameters
View Source
RunAsync()
Declaration
Returns
View Source
Sql()
Creates a new Sql statement.
Declaration
protected Sql<ISqlContext> Sql()
Returns
View Source
Sql(string, params object[])
Creates a new Sql statement with arguments.
Declaration
protected Sql<ISqlContext> Sql(string sql, params object[] args)
Parameters
| Type |
Name |
Description |
| string |
sql |
|
| object[] |
args |
|
Returns
View Source
TableExists(string)
Declaration
protected bool TableExists(string tableName)
Parameters
| Type |
Name |
Description |
| string |
tableName |
|
Returns