Skip to content

Commit 7fd2125

Browse files
committed
0.4/2017-11-09--transaction_participants_url_length.xml: fix "max key length is 767 bytes" error from MySQL.
Correction for cee66fd commit.
1 parent 07c661d commit 7fd2125

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/main/resources/liquibase/version/0.4/2017-11-09--transaction_participants_url_length.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@
55
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
66
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">
77

8+
<changeSet id="modify-transaction_participants-url-charset" author="php-coder" context="scheme" dbms="mysql">
9+
<!--
10+
Fix for "liquibase.exception.DatabaseException:
11+
Specified key was too long; max key length is 767 bytes
12+
[Failed SQL: ALTER TABLE mystamps.transaction_participants MODIFY url VARCHAR(285)]".
13+
See also: https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes
14+
-->
15+
<comment>
16+
Change character set from utf8 to ascii for a URL field to be able to have a unique
17+
constraint on a field that has length greater than 255 characters.
18+
</comment>
19+
20+
<sql>
21+
ALTER TABLE transaction_participants
22+
MODIFY url VARCHAR(285)
23+
CHARACTER SET ascii
24+
</sql>
25+
26+
</changeSet>
27+
828
<changeSet id="modify-transaction_participants-url-field" author="php-coder" context="scheme">
929
<modifyDataType tableName="transaction_participants" columnName="url" newDataType="VARCHAR(285)" />
1030
</changeSet>

0 commit comments

Comments
 (0)