public Column(string name, ColumnType type) { if (type == null) throw new ArgumentNullException("type"); Name = name; ColumnType = type; }
public Column(string name, ColumnType type, ColumnProperty property = ColumnProperty.None, object defaultValue = null) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } if (type == null) { throw new ArgumentNullException("type"); } Name = name; ColumnType = type; ColumnProperty = property; DefaultValue = defaultValue; }
protected override string GetSqlChangeColumnType(SchemaQualifiedObjectName table, string column, ColumnType columnType) { string columnTypeSql = typeMap.Get(columnType); return FormatSql("ALTER TABLE {0:NAME} MODIFY {1:NAME} {2}", table, column, columnTypeSql); }
public string Get(ColumnType columnType) { return Get(columnType.DataType, columnType.Length, columnType.Scale); }
private ColumnType GetColumnType() { var columnType = new ColumnType(ColumnType); columnType.Length = ColumnLength ?? Defaults.ColumnSize; if (ColumnScale != null) { columnType.Scale = ColumnScale; } return columnType; }
protected override string GetSqlChangeColumnType(SchemaQualifiedObjectName table, string column, ColumnType columnType) { string sqlColumnType = typeMap.Get(columnType); return FormatSql("ALTER TABLE {0:NAME} ALTER COLUMN {1:NAME} TYPE {2}", table.Name, column, sqlColumnType); }
protected virtual string GetSqlChangeColumnType(SchemaQualifiedObjectName table, string column, ColumnType columnType) { string columnTypeSql = typeMap.Get(columnType); return FormatSql("ALTER TABLE {0:NAME} ALTER COLUMN {1:NAME} {2}", table, column, columnTypeSql); }
public virtual void ChangeColumn(SchemaQualifiedObjectName table, string column, ColumnType columnType, bool notNull) { string sqlChangeColumn = GetSqlChangeColumnType(table, column, columnType); string sqlChangeNotNullConstraint = GetSqlChangeNotNullConstraint( table, column, notNull, ref sqlChangeColumn); if (!string.IsNullOrWhiteSpace(sqlChangeColumn)) { ExecuteNonQuery(sqlChangeColumn); } if (!string.IsNullOrWhiteSpace(sqlChangeNotNullConstraint)) { ExecuteNonQuery(sqlChangeNotNullConstraint); } }
public Column(string name, ColumnType type, ColumnProperty property, object defaultValue) : this(name, type) { ColumnProperty = property; DefaultValue = defaultValue; }
public Column(string name, ColumnType type, object defaultValue) : this(name, type) { DefaultValue = defaultValue; }
public Column(string name, ColumnType type, ColumnProperty property) : this(name, type) { ColumnProperty = property; }
public void SetColumnType(ColumnType type) { if (type == null) throw new ArgumentNullException("type"); ColumnType = type; }
protected Column() { ColumnType = new ColumnType(default(DbType)); }
/// <summary> /// Get the name of the database type associated with the given /// </summary> /// <param name="type">The DbType</param> /// <returns>The database type name used by ddl.</returns> public virtual string GetTypeName(ColumnType type) { return typeNames.Get(type); }