Beispiel #1
0
        protected override Expression VisitConstraintAction(SqlConstraintActionExpression actionExpression)
        {
            this.Write(actionExpression.ActionType.ToString().ToUpper());
            this.Write(" ");
            this.Visit(actionExpression.ConstraintExpression);

            return(actionExpression);
        }
        protected override Expression VisitForeignKeyConstraint(SqlForeignKeyConstraintExpression foreignKeyConstraintExpression)
        {
            var action             = new SqlConstraintActionExpression(SqlConstraintActionType.Add, foreignKeyConstraintExpression);
            var amendmentEpression = new SqlAlterTableExpression(this.currentTable.Table, action);

            this.amendments.Add(amendmentEpression);

            return(null);
        }
Beispiel #3
0
        protected override Expression VisitConstraint(SqlConstraintExpression expression)
        {
            if (expression.ReferencesExpression == null)
            {
                return(expression);
            }

            var action             = new SqlConstraintActionExpression(SqlConstraintActionType.Add, expression);
            var amendmentEpression = new SqlAlterTableExpression(this.currentTable.Table, action);

            this.amendments.Add(amendmentEpression);

            return(null);
        }
 protected virtual Expression VisitConstraintAction(SqlConstraintActionExpression actionExpression)
 {
     return(actionExpression);
 }