I have a table something like this:
Table: Deal Columns: Id int, deal int[]
Each entry in deal array references some other table id. How can we create the migration for the structure? Also, how can we create array column in knex for postgres.
You can use the specificType method for that:
knex.schema.createTable('deal', function(t) {
t.increments()
t.specificType('deal', 'INT[]')
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With