예제 #1
0
        public string Declaration()
        {
            var declaration = !IsPrimaryKey && AllowNulls ? "NULL" : "NOT NULL";

            if (DefaultExpression.IsNotEmpty())
            {
                declaration += " DEFAULT " + DefaultExpression;
            }

            return($"{declaration} {ColumnChecks.Select(x => x.FullDeclaration()).Join(" ")}".TrimEnd());
        }
예제 #2
0
 public virtual bool CanAdd()
 {
     return(AllowNulls || DefaultExpression.IsNotEmpty());
 }