Exemple #1
0
        protected virtual void Generate([NotNull] RenameTableOperation operation, [NotNull] IndentedStringBuilder builder)
        {
            Check.NotNull(operation, nameof(operation));
            Check.NotNull(builder, nameof(builder));

            builder.AppendLine(".RenameTable(");

            using (builder.Indent())
            {
                builder
                .Append("name: ")
                .Append(_code.Literal(operation.Name));

                if (operation.Schema != null)
                {
                    builder
                    .AppendLine(",")
                    .Append("schema: ")
                    .Append(_code.Literal(operation.Schema));
                }

                if (operation.NewName != null)
                {
                    builder
                    .AppendLine(",")
                    .Append("newName: ")
                    .Append(_code.Literal(operation.NewName));
                }

                if (operation.NewSchema != null)
                {
                    builder
                    .AppendLine(",")
                    .Append("newSchema: ")
                    .Append(_code.Literal(operation.NewSchema));
                }

                builder.Append(")");

                Annotations(operation.GetAnnotations(), builder);
            }
        }