I'm using Node.js and Knex to build a service for my router. However, I can't figure out how to add a column to an existing table, any help would be appreciated. Also, I'm using PostgreSQL, but I don't think that matters for the question.
So, this is what I have for adding rows to the table:
insertData(knex, table, row) {
return knex
.insert(row)
.into(table)
.returning('*')
.then(rows => {
return rows[0];
});
}
I'm guessing adding a column to the table would be something similar to this? I just can't figure out/find the solution.