OrmLiteSchemaModifyApi
Assembly: ServiceStack.OrmLite.dll
View Source
Declaration
public static class OrmLiteSchemaModifyApi : object
Methods
AlterTable<T>(IDbConnection, String)
View Source
Declaration
public static void AlterTable<T>(this IDbConnection dbConn, string command)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | command |
Type Parameters
T
AlterTable(IDbConnection, Type, String)
View Source
Declaration
public static void AlterTable(this IDbConnection dbConn, Type modelType, string command)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
System.String | command |
AddColumn<T>(IDbConnection, Expression<Func<T, Object>>)
View Source
Declaration
public static void AddColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
Type Parameters
T
AddColumn(IDbConnection, Type, FieldDefinition)
View Source
Declaration
public static void AddColumn(this IDbConnection dbConn, Type modelType, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
AddColumn(IDbConnection, String, FieldDefinition)
View Source
Declaration
public static void AddColumn(this IDbConnection dbConn, string table, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
AddColumn(IDbConnection, String, String, FieldDefinition)
View Source
Declaration
public static void AddColumn(this IDbConnection dbConn, string schema, string table, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
AlterColumn<T>(IDbConnection, Expression<Func<T, Object>>)
View Source
Declaration
public static void AlterColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
Type Parameters
T
AlterColumn(IDbConnection, Type, FieldDefinition)
View Source
Declaration
public static void AlterColumn(this IDbConnection dbConn, Type modelType, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
AlterColumn(IDbConnection, String, FieldDefinition)
View Source
Declaration
public static void AlterColumn(this IDbConnection dbConn, string table, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
AlterColumn(IDbConnection, String, String, FieldDefinition)
View Source
Declaration
public static void AlterColumn(this IDbConnection dbConn, string schema, string table, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ChangeColumnName<T>(IDbConnection, Expression<Func<T, Object>>, String)
View Source
Declaration
public static void ChangeColumnName<T>(this IDbConnection dbConn, Expression<Func<T, object>> field, string oldColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
System.String | oldColumn |
Type Parameters
T
ChangeColumnName(IDbConnection, Type, FieldDefinition, String)
View Source
Declaration
public static void ChangeColumnName(this IDbConnection dbConn, Type modelType, FieldDefinition fieldDef, string oldColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.String | oldColumn |
RenameColumn<T>(IDbConnection, Expression<Func<T, Object>>, String)
View Source
Declaration
public static void RenameColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field, string oldColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
System.String | oldColumn |
Type Parameters
T
RenameColumn<T>(IDbConnection, String, String)
View Source
Declaration
public static void RenameColumn<T>(this IDbConnection dbConn, string oldColumn, string newColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | oldColumn |
System.String | newColumn |
Type Parameters
T
RenameColumn(IDbConnection, Type, String, String)
View Source
Declaration
public static void RenameColumn(this IDbConnection dbConn, Type modelType, string oldColumn, string newColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
System.String | oldColumn |
System.String | newColumn |
RenameColumn(IDbConnection, String, String, String)
View Source
Declaration
public static void RenameColumn(this IDbConnection dbConn, string table, string oldColumn, string newColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | table |
System.String | oldColumn |
System.String | newColumn |
RenameColumn(IDbConnection, String, String, String, String)
View Source
Declaration
public static void RenameColumn(this IDbConnection dbConn, string schema, string table, string oldColumn, string newColumn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | schema |
System.String | table |
System.String | oldColumn |
System.String | newColumn |
DropColumn<T>(IDbConnection, Expression<Func<T, Object>>)
View Source
Declaration
public static void DropColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
Type Parameters
T
DropColumn<T>(IDbConnection, String)
View Source
Declaration
public static void DropColumn<T>(this IDbConnection dbConn, string column)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | column |
Type Parameters
T
DropColumn(IDbConnection, Type, String)
View Source
Declaration
public static void DropColumn(this IDbConnection dbConn, Type modelType, string column)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
System.String | column |
DropColumn(IDbConnection, String, String)
View Source
Declaration
public static void DropColumn(this IDbConnection dbConn, string table, string column)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | table |
System.String | column |
DropColumn(IDbConnection, String, String, String)
View Source
Declaration
public static void DropColumn(this IDbConnection dbConn, string schema, string table, string column)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | schema |
System.String | table |
System.String | column |
AddForeignKey<T, TForeign>(IDbConnection, Expression<Func<T, Object>>, Expression<Func<TForeign, Object>>, OnFkOption, OnFkOption, String)
View Source
Declaration
public static void AddForeignKey<T, TForeign>(this IDbConnection dbConn, Expression<Func<T, object>> field, Expression<Func<TForeign, object>> foreignField, OnFkOption onUpdate, OnFkOption onDelete, string foreignKeyName = null)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
Expression<Func<<TForeign>,System.Object>> | foreignField |
ServiceStack.OrmLite.OnFkOption | onUpdate |
ServiceStack.OrmLite.OnFkOption | onDelete |
System.String | foreignKeyName |
Type Parameters
T
TForeign
DropForeignKey<T>(IDbConnection, String)
View Source
Declaration
public static void DropForeignKey<T>(this IDbConnection dbConn, string foreignKeyName)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | foreignKeyName |
Type Parameters
T
CreateIndex<T>(IDbConnection, Expression<Func<T, Object>>, String, Boolean)
View Source
Declaration
public static void CreateIndex<T>(this IDbConnection dbConn, Expression<Func<T, object>> field, string indexName = null, bool unique = false)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Expression<Func<<T>,System.Object>> | field |
System.String | indexName |
System.Boolean | unique |
Type Parameters
T
DropIndex<T>(IDbConnection, String)
View Source
Declaration
public static void DropIndex<T>(this IDbConnection dbConn, string indexName)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
System.String | indexName |
Type Parameters
T
Migrate(IDbConnection, Type)
Alter tables by adding properties for missing columns and removing properties annotated with [RemoveColumn]
View Source
Declaration
public static void Migrate(this IDbConnection dbConn, Type modelType)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |
Revert(IDbConnection, Type)
Apply schema changes by Migrate in reverse to revert changes
View Source
Declaration
public static void Revert(this IDbConnection dbConn, Type modelType)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
Type | modelType |