Class MigrationBase
Provides a base class to all migrations.
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public abstract class MigrationBase : IDiscoverable
Constructors
MigrationBase(IMigrationContext)
Declaration
protected MigrationBase(IMigrationContext context)
Parameters
Properties
Alter
Builds an Alter expression.
Declaration
public IAlterBuilder Alter { get; }
Property Value
Type |
Description |
IAlterBuilder |
|
Context
Gets the migration context.
Declaration
protected IMigrationContext Context { get; }
Property Value
Create
Builds a Create expression.
Declaration
public ICreateBuilder Create { get; }
Property Value
Type |
Description |
ICreateBuilder |
|
Database
Gets the database instance.
Declaration
protected IUmbracoDatabase Database { get; }
Property Value
Type |
Description |
IUmbracoDatabase |
|
DatabaseType
Declaration
protected DatabaseType DatabaseType { get; }
Property Value
Type |
Description |
DatabaseType |
|
Delete
Builds a Delete expression.
Declaration
public IDeleteBuilder Delete { get; }
Property Value
Type |
Description |
IDeleteBuilder |
|
Execute
Builds an Execute expression.
Declaration
public IExecuteBuilder Execute { get; }
Property Value
Type |
Description |
IExecuteBuilder |
|
Insert
Builds an Insert expression.
Declaration
public IInsertBuilder Insert { get; }
Property Value
Type |
Description |
IInsertBuilder |
|
Logger
Declaration
protected ILogger Logger { get; }
Property Value
Rename
Builds a Rename expression.
Declaration
public IRenameBuilder Rename { get; }
Property Value
Type |
Description |
IRenameBuilder |
|
SqlSyntax
Declaration
protected ISqlSyntaxProvider SqlSyntax { get; }
Property Value
Type |
Description |
ISqlSyntaxProvider |
|
Update
Builds an Update expression.
Declaration
public IUpdateBuilder Update { get; }
Property Value
Type |
Description |
IUpdateBuilder |
|
Methods
AddColumn<T>(String)
Declaration
protected void AddColumn<T>(string columnName)
Parameters
Type |
Name |
Description |
System.String |
columnName |
|
Type Parameters
AddColumn<T>(String, out IEnumerable<String>)
Declaration
protected void AddColumn<T>(string columnName, out IEnumerable<string> sqls)
Parameters
Type |
Name |
Description |
System.String |
columnName |
|
System.Collections.Generic.IEnumerable<System.String> |
sqls |
|
Type Parameters
AddColumn<T>(String, String)
Declaration
protected void AddColumn<T>(string tableName, string columnName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
columnName |
|
Type Parameters
AddColumn<T>(String, String, out IEnumerable<String>)
Declaration
protected void AddColumn<T>(string tableName, string columnName, out IEnumerable<string> sqls)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
columnName |
|
System.Collections.Generic.IEnumerable<System.String> |
sqls |
|
Type Parameters
AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, String)
Declaration
protected void AddColumnIfNotExists<T>(IEnumerable<ColumnInfo> columns, string columnName)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<ColumnInfo> |
columns |
|
System.String |
columnName |
|
Type Parameters
AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, String, String)
Declaration
protected void AddColumnIfNotExists<T>(IEnumerable<ColumnInfo> columns, string tableName, string columnName)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<ColumnInfo> |
columns |
|
System.String |
tableName |
|
System.String |
columnName |
|
Type Parameters
AlterColumn<T>(String, String)
Declaration
protected void AlterColumn<T>(string tableName, string columnName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
columnName |
|
Type Parameters
ColumnExists(String, String)
Declaration
protected bool ColumnExists(string tableName, string columnName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
columnName |
|
Returns
Type |
Description |
System.Boolean |
|
ColumnType(String, String)
Declaration
protected string ColumnType(string tableName, string columnName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
columnName |
|
Returns
Type |
Description |
System.String |
|
IndexExists(String)
Declaration
protected bool IndexExists(string indexName)
Parameters
Type |
Name |
Description |
System.String |
indexName |
|
Returns
Type |
Description |
System.Boolean |
|
Migrate()
Declaration
protected abstract void Migrate()
ReplaceColumn<T>(String, String, String)
Declaration
protected void ReplaceColumn<T>(string tableName, string currentName, string newName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
currentName |
|
System.String |
newName |
|
Type Parameters
Run()
Declaration
Sql()
Creates a new Sql statement.
Declaration
protected Sql<ISqlContext> Sql()
Returns
Type |
Description |
Sql<ISqlContext> |
|
Sql(String, Object[])
Creates a new Sql statement with arguments.
Declaration
protected Sql<ISqlContext> Sql(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
Sql<ISqlContext> |
|
TableExists(String)
Declaration
protected bool TableExists(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
Type |
Description |
System.Boolean |
|