Skip to content

Commit

Permalink
fix: Update default charset and collation for mysql - EXO-75202
Browse files Browse the repository at this point in the history
With mysql 8.4, the default charset and collation are updated from UTF to UTF8MB4. In addition NVARCHAR is now deprecated and replaced by VARCHAR.
This commit adapt liquibase changes in order to apply this change.
  • Loading branch information
rdenarie authored and exo-swf committed Nov 12, 2024
1 parent d709bb1 commit 06363ce
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@
</changeSet>

<changeSet author="attachments" id="1.0.0-1">
<validCheckSum>ANY</validCheckSum>
<createTable tableName="EXO_ATTACHMENTS_CONTEXT">
<column name="ATTACHMENTS_CONTEXT_ID" type="BIGINT" autoIncrement="${autoIncrement}" startWith="1">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_ATTACHMENTS_CONTEXT" />
</column>
<column name="ATTACHMENT_ID" type="NVARCHAR(200)"/>
<column name="ATTACHMENT_ID" type="VARCHAR(200)"/>
<column name="ENTITY_ID" type="BIGINT" />
<column name="ENTITY_TYPE" type="NVARCHAR(200)" />
<column name="ENTITY_TYPE" type="VARCHAR(200)" />
<column name="ATTACHED_DATE" type="BIGINT" />
</createTable>
<modifySql dbms="mysql">
<append value=" ENGINE=INNODB CHARSET=UTF8 COLLATE utf8_general_ci" />
<append value=" ENGINE=INNODB CHARSET=UTF8MB4 COLLATE utf8mb4_0900_ai_ci" />
</modifySql>
</changeSet>

Expand All @@ -52,9 +53,10 @@
</changeSet>

<changeSet author="attachments" id="1.0.0-3">
<validCheckSum>ANY</validCheckSum>
<addNotNullConstraint columnName="ATTACHMENT_ID"
constraintName="ATTACHMENTS_CONTEXT_ID_NON_NULL"
columnDataType="NVARCHAR(200)"
columnDataType="VARCHAR(200)"
tableName="EXO_ATTACHMENTS_CONTEXT"/>
</changeSet>

Expand All @@ -67,5 +69,9 @@
<changeSet author="attachments" id="1.0.0-5" dbms="hsqldb">
<createSequence sequenceName="SEQ_ATTACHMENTS_CONTEXT_ID" startValue="1" />
</changeSet>

<changeSet author="attachments" id="1.0.0-6" >
<sql dbms="mysql">
ALTER TABLE EXO_ATTACHMENTS_CONTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
</sql>
</changeSet>
</databaseChangeLog>

0 comments on commit 06363ce

Please sign in to comment.