Skip to content

Commit fe90b9f

Browse files
committed
revert back to utf8 due to indexing issues, even though it's inferior
problem: "Specified key was too long; max key length is 767 bytes (SQL State: 42000 - Error Code: 1071)" more info: - https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-upgrading.html - https://mathiasbynens.be/notes/mysql-utf8mb4 - https://make.wordpress.org/core/2015/04/02/the-utf8mb4-upgrade/
1 parent 5c904c5 commit fe90b9f

2 files changed

Lines changed: 35 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SteVe is designed to run standalone, a java servlet container / web server (e.g.
3939
The following MySQL statements can be used as database initialization (adjust according to your setup):
4040

4141
```
42-
CREATE DATABASE stevedb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
42+
CREATE DATABASE stevedb CHARACTER SET utf8 COLLATE utf8_unicode_ci;
4343
GRANT ALL PRIVILEGES ON stevedb.* TO 'steve'@'localhost' IDENTIFIED BY 'changeme';
4444
GRANT SELECT ON mysql.proc TO 'steve'@'localhost' IDENTIFIED BY 'changeme';
4545
```

src/main/resources/db/migration/V0_8_6__update.sql

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
-- and also we cannot touch book keeping table "schema_version" of flyway,
99
-- since it will be in use during the migration.
1010
--
11-
-- https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
12-
-- http://stackoverflow.com/a/766996
13-
--
1411

1512
LOCK TABLES
1613
address WRITE,
@@ -26,17 +23,41 @@ LOCK TABLES
2623

2724
SET FOREIGN_KEY_CHECKS = 0;
2825

29-
ALTER TABLE address CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
30-
ALTER TABLE charge_box CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
31-
ALTER TABLE connector CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
32-
ALTER TABLE connector_meter_value CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
33-
ALTER TABLE connector_status CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
34-
ALTER TABLE ocpp_tag CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
35-
ALTER TABLE reservation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
36-
ALTER TABLE settings CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
37-
ALTER TABLE `transaction` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
38-
ALTER TABLE `user` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
26+
ALTER TABLE charge_box CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
27+
ALTER TABLE address CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
28+
ALTER TABLE connector CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
29+
ALTER TABLE connector_meter_value CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
30+
ALTER TABLE connector_status CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
31+
ALTER TABLE ocpp_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
32+
ALTER TABLE reservation CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
33+
ALTER TABLE settings CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
34+
ALTER TABLE `transaction` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
35+
ALTER TABLE `user` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
3936

4037
SET FOREIGN_KEY_CHECKS = 1;
4138

4239
UNLOCK TABLES;
40+
41+
REPAIR TABLE
42+
address,
43+
charge_box,
44+
connector,
45+
connector_meter_value,
46+
connector_status,
47+
ocpp_tag,
48+
reservation,
49+
settings,
50+
`transaction`,
51+
`user`;
52+
53+
OPTIMIZE TABLE
54+
address,
55+
charge_box,
56+
connector,
57+
connector_meter_value,
58+
connector_status,
59+
ocpp_tag,
60+
reservation,
61+
settings,
62+
`transaction`,
63+
`user`;

0 commit comments

Comments
 (0)