Storage capacity of TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT in MySQL Database

You can store text of various sizes in MySQL database. Although, VARCHAR formats are common for smaller text, mysql provides an alternative to store texts. Here are the different data type and their capacity.

  1. TINYTEXT – Can hold up to 255 bytes i.e. 255 characters with 1 byte overhead.
  2. SMALLTEXT – Can hold up to 64,535 characters which is equivalent to 64KB and requires 2 bytes overhead.
  3. MEDIUMTEXT – Can hold up to 16,777,215 characters i.e. 16MB and has 3 bytes overhead.
  4. LONGTEXT – Can hold up to 4,294,967,295 charactesr i..e. 4GB of text and has 4 bytes overhead.

If you would like to store your non-text files such as images etc., you can use BLOB format.

Checksum Mismatch on Flyway – Spring Boot

I created some test tables via flyway, since they were successful, I deleted the tables, scripts and restarted versioning from V1. However, it appears that Flyway maintains a version of the database migration, which prevented me from running the app with an ugly error that said the checksum mismatch occurred on Flyway.

There is an easy fix for that though. You just need to set the following flag in your application properties.

spring.flyway.validateOnMigrate= false

You might however want to do that on your non-prod profiles, that way you are still validating the production.