Varchar(max) equivalent in migrations code


#1

I’m used to SQL Server databases, whereby I can create varchar(max) fields for very large text columns. What would the equivalent statement be in a Lucid migration-- table.text() I assume?

Also, just wondering: In the Knex docs they mention an optional MySQL parameter in that function for largetext and medium text columns. Would anyone know if that also holds for SQL Server and/or Postgres?


#2

In lucid migration you can use string for varchar fields

table.string('name', [length]) default length it’s 255

About your second question, I don’t know for SQL Server, but in postgres it’s valid, it will create a long text field (I’ve use it in my project)


#3

Thanks for the info.