When creating a table in knex migrations, I have indicated a col as such:
table.string("content");
It defaults to varchar 255. I would like it to be able to hold more text. How do I indicate to knex that I want this to occur?
When creating a table in knex migrations, I have indicated a col as such:
table.string("content");
It defaults to varchar 255. I would like it to be able to hold more text. How do I indicate to knex that I want this to occur?
There is also other way to do it:
table.text(columnName, [textType]);
Adds a text column, with optional textType for MySql text datatype preference where textType defaults to text.
PSQL text type description: variable unlimited length.
References:
http://knexjs.org/#Schema-text
https://www.postgresql.org/docs/9.1/datatype-character.html
https://chartio.com/resources/tutorials/understanding-strorage-sizes-for-mysql-text-data-types/