Can I create a column of nvarchar(MAX) using FluentMigrator?

You could create an extension method to wrap .AsString(Int32.MaxValue) within .AsMaxString()

e.g.

internal static class MigratorExtensions
{
    public static ICreateTableColumnOptionOrWithColumnSyntax AsMaxString(this ICreateTableColumnAsTypeSyntax createTableColumnAsTypeSyntax)
    {
        return createTableColumnAsTypeSyntax.AsString(int.MaxValue);
    }
}

OK, I found it. Basically, use .AsString(Int32.MaxValue). Pity there's not a .AsMaxString() method, but I guess it's easy enough to put in...


You can use AsCustom("nvarchar(max)") and pack it to extension