MySQL Database Field Types

4 years 3 weeks ago #317537 by sentix
MySQL Database Field Types was created by sentix
Hi, i am now starting a new project with CB (2.4.4) after some time.

I wonder that when I create a field, for example to store a text area, even if I limit amount of data to 1000 characters, CB uses MEDIUMTEXT size fields.

For all different fields, I see that CB uses quite large fields.

How does CB determine the field type and size? And how can I prevent that CB always resets the field type after an update if I changed the type manually in the database?

Thanks.

Manfred

Versions: CB 2.7.2, J 3.10.6

Please Log in to join the conversation.

4 years 3 weeks ago #317541 by krileon
Replied by krileon on topic MySQL Database Field Types
Textarea will always use mediumtext and Text will always use text. Most fields will use text type if they've unknown size limits. The length parameter is just a PHP side validation check and does not impact storage. None of this should really matter to an Innodb database though as it'll use separate small pointers for those columns anyway. You can change the database column type if you want, but it may change back once you save the field again.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: sentix

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.294 seconds

Facebook Twitter LinkedIn