Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nikocraft's avatar

should I use text or longtext for table column?

whats the difference? is text() enough?

I just found abuot this: $table->longText('description');

and made me wonder if text alone would be enough for content that can be of any lenght, lets say blog post, which one do you use?

0 likes
3 replies
nikocraft's avatar

Is there any performance of memory penalty for defining mediumtext instead of just text? I may go with mediumtext since I do not know in advance what enduser may decide to put into the body of a blog post for example documentation which could be as large as 50 pages book etc. What do you think of mediumtext for such a case @samalapsy ?

samalapsy's avatar

yes you're right @maxnb. It's very useful when dealing with large contents.

Please or to participate in this conversation.