title: Spring Boot & Hibernate: MySQL TEXT with local h2 and Flyway
body: <p>I am building a Spring Boot application which has several long texts in it's entities.</p>
  
  <p>To ensure I can handle my database migrations well I included Flyway. In production I'm using a MySQL database, for local testing I want to implement the default h2 database.</p>
  
  <p>An entity might have the following property</p>
  
  <pre><code>@Column(columnDefinition = "TEXT")
  val startText: String?
  </code></pre>
  
  <p>For my MySQL database, this works fine and looks like this in my flyway schema:</p>
  
  <p><code>start_text  TEXT,</code></p>
  
  <p>When I now start my tests with the default h2 in-memory database in Spring, I receive the following error:</p>
  
  <pre><code>Schema-validation: wrong column type encountered in column [start_text] in table [t_table]; found [clob (Types#CLOB)], but expecting [text (Types#VARCHAR)]
  </code></pre>
  
  <p>I understand that h2 does not support the MySQL specific type <code>TEXT</code> but actually I have no clue how to fix this.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thank you.</p>