Search code examples
arrayspostgresqlknex.js

syntax for string array migration


It seems postgres arrays are supported knex #226. Is there syntax for a migration beyond raw sql? The schema building docs don't mention it.

Presumably the raw sql datatype using the postgres array docs would be:

table.specificType('arrayfield', 'text[]')

But is there something like:

table.string('arrayfield').array()

Solution

  • Yeah, the specificType would be the way to go here, there's currently no OO interface for dealing with postgres specific types.