47 var dataType = DataTypeBuilder.Build(typeResolver,
DataType);
52 columnInfo.DefaultExpression = ExpressionBuilder.Build(
Default);
57 columnInfo.IsIdentity =
true;
61 if (
String.Equals(ConstraintTypeNames.Check, constraint.ConstraintType, StringComparison.OrdinalIgnoreCase)) {
62 var exp = ExpressionBuilder.Build(constraint.CheckExpression);
64 }
else if (
String.Equals(ConstraintTypeNames.ForeignKey, constraint.ConstraintType, StringComparison.OrdinalIgnoreCase)) {
65 var fTable = constraint.ReferencedTable.Name;
66 var fColumn = constraint.ReferencedColumn.Text;
70 if (!
String.IsNullOrEmpty(constraint.OnDeleteAction))
71 onDelete = StatementBuilder.GetForeignKeyAction(constraint.OnDeleteAction);
72 if (!
String.IsNullOrEmpty(constraint.OnUpdateAction))
73 onUpdate = StatementBuilder.GetForeignKeyAction(constraint.OnUpdateAction);
76 }
else if (
String.Equals(ConstraintTypeNames.PrimaryKey, constraint.ConstraintType, StringComparison.OrdinalIgnoreCase)) {
78 }
else if (
String.Equals(ConstraintTypeNames.UniqueKey, constraint.ConstraintType, StringComparison.OrdinalIgnoreCase)) {
80 }
else if (
String.Equals(ConstraintTypeNames.NotNull, constraint.ConstraintType, StringComparison.OrdinalIgnoreCase)) {
81 columnInfo.IsNotNull =
true;
82 }
else if (
String.Equals(ConstraintTypeNames.Null, constraint.ConstraintType, StringComparison.OrdinalIgnoreCase)) {
83 columnInfo.IsNotNull =
false;
IdentifierNode ColumnName
A long string in the system.
static SqlTableConstraint PrimaryKey(string constraintName, string[] columns)
ForeignKeyAction
Enumerates the foreign key referential trigger actions.
static SqlTableConstraint UniqueKey(string constraintName, string[] columns)
static SqlBinaryExpression Add(SqlExpression left, SqlExpression right)
string Text
Gets the textual content of the identifier.
IEnumerable< ColumnConstraintNode > Constraints
static SqlTableConstraint Check(string constraintName, SqlExpression expression)
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
static SqlFunctionCallExpression FunctionCall(ObjectName functionName)
static SqlTableConstraint ForeignKey(string constraintName, string[] columns, string refTable, string[] refcolumns, ForeignKeyAction onDelete, ForeignKeyAction onUpdate)