Skip to main content

Migrator

Assembly: ServiceStack.OrmLite.dll
View Source
Declaration
public class Migrator : object

Properties

DbFactory

View Source
Declaration
public IDbConnectionFactory DbFactory { get; }

MigrationTypes

View Source
Declaration
public Type[] MigrationTypes { get; }

Timeout

View Source
Declaration
public TimeSpan Timeout { get; set; }

Log

View Source
Declaration
public ILog Log { get; set; }

Fields

All

View Source
Declaration
public const string All = null

Last

View Source
Declaration
public const string Last = null

Methods

Run()

View Source
Declaration
public AppTaskResult Run()
Returns

ServiceStack.AppTaskResult

Run(Boolean)

View Source
Declaration
public AppTaskResult Run(bool throwIfError)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
System.BooleanthrowIfError

GetAllMigrationTypes(Assembly[])

View Source
Declaration
public static List<Type> GetAllMigrationTypes(params Assembly[] migrationAssemblies)
Returns

List<Type>

Parameters
TypeName
Assembly[]migrationAssemblies

Init(IDbConnection)

View Source
Declaration
public static void Init(IDbConnection db)
Parameters
TypeName
IDbConnectiondb

Recreate(IDbConnection)

View Source
Declaration
public static void Recreate(IDbConnection db)
Parameters
TypeName
IDbConnectiondb

Clear(IDbConnection)

View Source
Declaration
public static void Clear(IDbConnection db)
Parameters
TypeName
IDbConnectiondb

Revert(Nullable<String>)

View Source
Declaration
public AppTaskResult Revert(string? migrationName)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
System.Nullable<System.String>migrationName

Revert(Nullable<String>, Boolean)

View Source
Declaration
public AppTaskResult Revert(string? migrationName, bool throwIfError)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
System.Nullable<System.String>migrationName
System.BooleanthrowIfError

Down(IDbConnectionFactory, Type)

View Source
Declaration
public static AppTaskResult Down(IDbConnectionFactory dbFactory, Type migrationType)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
ServiceStack.Data.IDbConnectionFactorydbFactory
TypemigrationType

Down(IDbConnectionFactory, Type[])

View Source
Declaration
public static AppTaskResult Down(IDbConnectionFactory dbFactory, Type[] migrationTypes)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
ServiceStack.Data.IDbConnectionFactorydbFactory
Type[]migrationTypes

Up(IDbConnectionFactory, Type)

View Source
Declaration
public static AppTaskResult Up(IDbConnectionFactory dbFactory, Type migrationType)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
ServiceStack.Data.IDbConnectionFactorydbFactory
TypemigrationType

Up(IDbConnectionFactory, Type[])

View Source
Declaration
public static AppTaskResult Up(IDbConnectionFactory dbFactory, Type[] migrationTypes)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
ServiceStack.Data.IDbConnectionFactorydbFactory
Type[]migrationTypes

Run(IDbConnectionFactory, Type, Action<MigrationBase>)

View Source
Declaration
public static MigrationBase Run(IDbConnectionFactory dbFactory, Type nextRun, Action<MigrationBase> migrateAction)
Returns

ServiceStack.OrmLite.MigrationBase

Parameters
TypeName
ServiceStack.Data.IDbConnectionFactorydbFactory
TypenextRun
Action<ServiceStack.OrmLite.MigrationBase>migrateAction

RunAll(IDbConnectionFactory, IEnumerable<Type>, Action<MigrationBase>)

View Source
Declaration
public static AppTaskResult RunAll(IDbConnectionFactory dbFactory, IEnumerable<Type> migrationTypes, Action<MigrationBase> migrateAction)
Returns

ServiceStack.AppTaskResult

Parameters
TypeName
ServiceStack.Data.IDbConnectionFactorydbFactory
IEnumerable<Type>migrationTypes
Action<ServiceStack.OrmLite.MigrationBase>migrateAction