I have a text field in my database in which I'm going to index the contents of a PDF file. Right now the database column for that field is defined as "TEXT" but I need more space since my PDF files can be quite large.

Can I change this column in the database to MEDIUMTEXT or LONGTEXT or will this be a problem with Craft somehow?


The underlying database column for the plain text field type is defined by it's Max Length setting under it's field settings.

If you set that to something crazy high (like greater than 4294967295), it should use Long Text.

This means that Craft will adapt and change the column type dynamic from how much "data" you need to store/define for the field. Very powerful!

Note or warning (from Brad Bell at P&T support) I'd make sure that you really need that much storage space (up to 4GB per row!). You can really start to choke MySQL by abusing that data type. Medium Text stores a very healthy 16MB, which is still a lot of data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.