public override IEnumerable<IAlterableCreateStatement> CreateStatementFragments(CreateFragmentMode mode) { List<TableDefinition> definitions = new List<TableDefinition>(); List<TableConstraint> constraints = new List<TableConstraint>(); foreach (TableDefinition definition in Definitions) { TableConstraint constraint = definition as TableConstraint; if ((constraint == null) || ((mode == CreateFragmentMode.CreateOnExistingSchema) && (constraint is TableUniqueConstraintBase)) || ((mode == CreateFragmentMode.CreateOnNewSchema) && constraint.IsPartOfSchemaDefinition)) { definitions.Add(definition); } else { constraints.Add(constraint); } } yield return new CreateTableFragment(this, definitions); foreach (TableConstraint constraint in constraints) { yield return new AlterTableAddConstraintFragment(this, constraint); } }
public abstract IEnumerable<IAlterableCreateStatement> CreateStatementFragments(CreateFragmentMode mode);
public override sealed IEnumerable<IAlterableCreateStatement> CreateStatementFragments(CreateFragmentMode mode) { yield return this; }