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?
You can define the col in following way to set the length of the string:
table.string("content", 1000)
This results to:
content character varying(1000)
Reference: http://knexjs.org/#Schema-string
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