From 023c0e62aeadf600f9d9ebffc6bb5392c8e387fd Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 22 Feb 2018 14:54:43 +0300 Subject: h2: varchar_ignorecase for tag names --- .../src/main/java/com/juick/configuration/DataConfiguration.java | 2 +- .../src/test/java/com/juick/service/MessageServiceTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-server-jdbc') diff --git a/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java index 03009565..f5ed724a 100644 --- a/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java +++ b/juick-server-jdbc/src/main/java/com/juick/configuration/DataConfiguration.java @@ -139,7 +139,7 @@ public class DataConfiguration implements TransactionManagementConfigurer { jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS tags(" + "tag_id int(10) unsigned NOT NULL AUTO_INCREMENT," + "synonym_id int(10) unsigned DEFAULT NULL," + - "name char(48) NOT NULL," + + "name varchar_ignorecase(48) NOT NULL," + "top tinyint(1) unsigned NOT NULL DEFAULT 0," + "stat_messages int(10) unsigned NOT NULL DEFAULT 0," + "stat_users smallint(5) unsigned NOT NULL DEFAULT 0)"); diff --git a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java index 8c54cae1..bdb9cdcb 100644 --- a/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java +++ b/juick-server-jdbc/src/test/java/com/juick/service/MessageServiceTest.java @@ -106,6 +106,7 @@ public class MessageServiceTest extends AbstractJUnit4SpringContextTests { User ugnich = userService.getUserByUID(ugnichId).orElse(AnonymousUser.INSTANCE); User freefd = userService.getUserByUID(freefdId).orElse(AnonymousUser.INSTANCE); Tag yoTag = tagService.getTag("yoyo", true); + assertThat(tagService.getTag("YOYO", false), equalTo(yoTag)); int mid = messagesService.createMessage(ugnichId, "yo", null, Collections.singletonList(yoTag)); List subscribers = subscriptionService.getSubscribedUsers(ugnichId, mid); -- cgit v1.2.3