public virtual IEnumerable <SqlBatch> Generate([NotNull] MigrationOperation operation)
        {
            Check.NotNull(operation, "operation");

            var batchBuilder = new SqlBatchBuilder();

            operation.GenerateSql(this, batchBuilder);
            batchBuilder.EndBatch();

            return(batchBuilder.SqlBatches);
        }
Beispiel #2
0
        public virtual SqlStatement Generate([NotNull] MigrationOperation operation)
        {
            Check.NotNull(operation, "operation");

            var builder = new IndentedStringBuilder();

            operation.GenerateSql(this, builder);

            // TODO: Should we support implementations of Generate that output more than one SQL statement?
            return(new SqlStatement(builder.ToString()));
        }
Beispiel #3
0
        protected virtual IEnumerable <SqlStatement> Generate([NotNull] MigrationOperation operation)
        {
            var builder = new IndentedStringBuilder();

            operation.GenerateSql(this, builder);

            if (DatabaseModelModifier != null)
            {
                operation.Accept(DatabaseModelModifier, Database);
            }

            // TODO: Should we support implementations of Generate that output more than one SQL statement?
            yield return(new SqlStatement(builder.ToString()));
        }
        public virtual SqlStatement Generate([NotNull] MigrationOperation operation)
        {
            Check.NotNull(operation, "operation");

            var builder = new IndentedStringBuilder();

            operation.GenerateSql(this, builder);

            var sqlOperation        = operation as SqlOperation;
            var suppressTransaction = sqlOperation != null && sqlOperation.SuppressTransaction;

            // TODO: Should we support implementations of Generate that output more than one SQL statement?
            return(new SqlStatement(builder.ToString())
            {
                SuppressTransaction = suppressTransaction
            });
        }