Skip to main content

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
TypeName
IDbConnectiondbConn
System.Stringcommand
Type Parameters
  • T

AlterTable(IDbConnection, Type, String)

View Source
Declaration
public static void AlterTable(this IDbConnection dbConn, Type modelType, string command)
Parameters
TypeName
IDbConnectiondbConn
TypemodelType
System.Stringcommand

AddColumn<T>(IDbConnection, Expression<Func<T, Object>>)

View Source
Declaration
public static void AddColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Parameters
TypeName
IDbConnectiondbConn
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
TypeName
IDbConnectiondbConn
TypemodelType
ServiceStack.OrmLite.FieldDefinitionfieldDef

AddColumn(IDbConnection, String, FieldDefinition)

View Source
Declaration
public static void AddColumn(this IDbConnection dbConn, string table, FieldDefinition fieldDef)
Parameters
TypeName
IDbConnectiondbConn
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef

AddColumn(IDbConnection, String, String, FieldDefinition)

View Source
Declaration
public static void AddColumn(this IDbConnection dbConn, string schema, string table, FieldDefinition fieldDef)
Parameters
TypeName
IDbConnectiondbConn
System.Stringschema
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef

AlterColumn<T>(IDbConnection, Expression<Func<T, Object>>)

View Source
Declaration
public static void AlterColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Parameters
TypeName
IDbConnectiondbConn
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
TypeName
IDbConnectiondbConn
TypemodelType
ServiceStack.OrmLite.FieldDefinitionfieldDef

AlterColumn(IDbConnection, String, FieldDefinition)

View Source
Declaration
public static void AlterColumn(this IDbConnection dbConn, string table, FieldDefinition fieldDef)
Parameters
TypeName
IDbConnectiondbConn
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef

AlterColumn(IDbConnection, String, String, FieldDefinition)

View Source
Declaration
public static void AlterColumn(this IDbConnection dbConn, string schema, string table, FieldDefinition fieldDef)
Parameters
TypeName
IDbConnectiondbConn
System.Stringschema
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef

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
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Object>>field
System.StringoldColumn
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
TypeName
IDbConnectiondbConn
TypemodelType
ServiceStack.OrmLite.FieldDefinitionfieldDef
System.StringoldColumn

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
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Object>>field
System.StringoldColumn
Type Parameters
  • T

RenameColumn<T>(IDbConnection, String, String)

View Source
Declaration
public static void RenameColumn<T>(this IDbConnection dbConn, string oldColumn, string newColumn)
Parameters
TypeName
IDbConnectiondbConn
System.StringoldColumn
System.StringnewColumn
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
TypeName
IDbConnectiondbConn
TypemodelType
System.StringoldColumn
System.StringnewColumn

RenameColumn(IDbConnection, String, String, String)

View Source
Declaration
public static void RenameColumn(this IDbConnection dbConn, string table, string oldColumn, string newColumn)
Parameters
TypeName
IDbConnectiondbConn
System.Stringtable
System.StringoldColumn
System.StringnewColumn

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
TypeName
IDbConnectiondbConn
System.Stringschema
System.Stringtable
System.StringoldColumn
System.StringnewColumn

DropColumn<T>(IDbConnection, Expression<Func<T, Object>>)

View Source
Declaration
public static void DropColumn<T>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Parameters
TypeName
IDbConnectiondbConn
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
TypeName
IDbConnectiondbConn
System.Stringcolumn
Type Parameters
  • T

DropColumn(IDbConnection, Type, String)

View Source
Declaration
public static void DropColumn(this IDbConnection dbConn, Type modelType, string column)
Parameters
TypeName
IDbConnectiondbConn
TypemodelType
System.Stringcolumn

DropColumn(IDbConnection, String, String)

View Source
Declaration
public static void DropColumn(this IDbConnection dbConn, string table, string column)
Parameters
TypeName
IDbConnectiondbConn
System.Stringtable
System.Stringcolumn

DropColumn(IDbConnection, String, String, String)

View Source
Declaration
public static void DropColumn(this IDbConnection dbConn, string schema, string table, string column)
Parameters
TypeName
IDbConnectiondbConn
System.Stringschema
System.Stringtable
System.Stringcolumn

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
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Object>>field
Expression<Func<<TForeign>,System.Object>>foreignField
ServiceStack.OrmLite.OnFkOptiononUpdate
ServiceStack.OrmLite.OnFkOptiononDelete
System.StringforeignKeyName
Type Parameters
  • T
  • TForeign

DropForeignKey<T>(IDbConnection, String)

View Source
Declaration
public static void DropForeignKey<T>(this IDbConnection dbConn, string foreignKeyName)
Parameters
TypeName
IDbConnectiondbConn
System.StringforeignKeyName
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
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Object>>field
System.StringindexName
System.Booleanunique
Type Parameters
  • T

DropIndex<T>(IDbConnection, String)

View Source
Declaration
public static void DropIndex<T>(this IDbConnection dbConn, string indexName)
Parameters
TypeName
IDbConnectiondbConn
System.StringindexName
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
TypeName
IDbConnectiondbConn
TypemodelType

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
TypeName
IDbConnectiondbConn
TypemodelType