BuildColumnSchema() public static method

public static BuildColumnSchema ( string type, string name, string default_value, DatabaseColumnConstraints constraints ) : string
type string
name string
default_value string
constraints DatabaseColumnConstraints
return string
Exemplo n.º 1
0
 void CheckProperty(Type type, DbColumn column)
 {
     if (!Connection.ColumnExists(TableName, column.Name))
     {
         AddColumnToTable(SqliteUtils.BuildColumnSchema(
                              SqliteUtils.GetType(type),
                              column.Name, column.DefaultValue, column.Constraints));
     }
 }
Exemplo n.º 2
0
 public void ClearProperty <U> (DbColumn column)
 {
     if (!Connection.ColumnExists(TableName, column.Name))
     {
         AddColumnToTable(SqliteUtils.BuildColumnSchema(
                              SqliteUtils.GetType(typeof(U)),
                              column.Name, column.DefaultValue, column.Constraints));
     }
     else
     {
         Connection.Execute(string.Format(
                                "UPDATE {0} SET {1}='{2}'",
                                TableName, column.Name, column.DefaultValue));
     }
 }