{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3996","repository_url":"https://api.github.com/repos/jhipster/generator-jhipster","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3996/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3996/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3996/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/3996","id":171645222,"number":3996,"title":"MySQL integration broken when using utf8mb4 encoding","user":{"login":"axelfontaine","id":684824,"avatar_url":"https://avatars.githubusercontent.com/u/684824?v=3","gravatar_id":"","url":"https://api.github.com/users/axelfontaine","html_url":"https://github.com/axelfontaine","followers_url":"https://api.github.com/users/axelfontaine/followers","following_url":"https://api.github.com/users/axelfontaine/following{/other_user}","gists_url":"https://api.github.com/users/axelfontaine/gists{/gist_id}","starred_url":"https://api.github.com/users/axelfontaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelfontaine/subscriptions","organizations_url":"https://api.github.com/users/axelfontaine/orgs","repos_url":"https://api.github.com/users/axelfontaine/repos","events_url":"https://api.github.com/users/axelfontaine/events{/privacy}","received_events_url":"https://api.github.com/users/axelfontaine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-17T12:29:13Z","updated_at":"2016-08-18T10:37:02Z","closed_at":null,"body":"##### **Overview of the issue**\r\n\r\nWhen using JHipster with a MySQL database configured to use UTF-8 (utf8mb4), the schema creation fails with `com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes` due to the reasons outlined here: http://stackoverflow.com/a/22515986/350428\r\n\r\n##### **Motivation for or Use Case**\r\n\r\nThe utf8mb4 encoding is the only *true* UTF-8 encoding for MySQL\r\n\r\n##### **Reproduce the error**\r\n\r\n1. Generate a new JHipster application and select MySQL. \r\n2. Configure the MySQL instance to use utf8mb4\r\n3. Configure the JHipster application to use that MySQL instance\r\n4. Start the JHipster application\r\n5. Liquibase fails due to the MySQL exception above!\r\n\r\n##### **Related issues**\r\n\r\nNone\r\n\r\n##### **Suggest a Fix**\r\n\r\nChange the varchar(255) references in the schema to varchar(191) or stop using varchar columns as primary keys\r\n\r\n##### **JHipster Version(s)**\r\n\r\nLatest from npm\r\n\r\n##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**\r\n\r\n```\r\n{\r\n  \"generator-jhipster\": {\r\n    \"jhipsterVersion\": \"3.5.1\",\r\n    \"baseName\": \"jhipapp\",\r\n    \"packageName\": \"com.mycompany.myapp\",\r\n    \"packageFolder\": \"com/mycompany/myapp\",\r\n    \"serverPort\": \"8080\",\r\n    \"authenticationType\": \"session\",\r\n    \"hibernateCache\": \"ehcache\",\r\n    \"clusteredHttpSession\": \"no\",\r\n    \"websocket\": \"no\",\r\n    \"databaseType\": \"sql\",\r\n    \"devDatabaseType\": \"h2Memory\",\r\n    \"prodDatabaseType\": \"mysql\",\r\n    \"searchEngine\": \"no\",\r\n    \"buildTool\": \"maven\",\r\n    \"enableSocialSignIn\": false,\r\n    \"rememberMeKey\": \"20ca46979c8e88947934d6947fa4e2788fc16bff\",\r\n    \"useSass\": false,\r\n    \"applicationType\": \"monolith\",\r\n    \"testFrameworks\": [\r\n      \"gatling\"\r\n    ],\r\n    \"jhiPrefix\": \"jhi\",\r\n    \"enableTranslation\": true,\r\n    \"nativeLanguage\": \"en\",\r\n    \"languages\": [\r\n      \"en\"\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n##### **Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**\r\n\r\nN/A\r\n\r\n##### **Browsers and Operating System**\r\n\r\nN/A (fails on startup, regardless of the OS)\r\n"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/240686910","html_url":"https://github.com/jhipster/generator-jhipster/issues/3996#issuecomment-240686910","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/3996","id":240686910,"user":{"login":"jdubois","id":316835,"avatar_url":"https://avatars.githubusercontent.com/u/316835?v=3","gravatar_id":"","url":"https://api.github.com/users/jdubois","html_url":"https://github.com/jdubois","followers_url":"https://api.github.com/users/jdubois/followers","following_url":"https://api.github.com/users/jdubois/following{/other_user}","gists_url":"https://api.github.com/users/jdubois/gists{/gist_id}","starred_url":"https://api.github.com/users/jdubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdubois/subscriptions","organizations_url":"https://api.github.com/users/jdubois/orgs","repos_url":"https://api.github.com/users/jdubois/repos","events_url":"https://api.github.com/users/jdubois/events{/privacy}","received_events_url":"https://api.github.com/users/jdubois/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T10:37:02Z","updated_at":"2016-08-18T10:37:02Z","body":"So I'm able to solve the length issue everywhere, excepted for our OAuth2 support (which isn't very widely used, less than 1% of people last month!!! So let's not worry too much).\r\nI'm not doing this for OAuth2 because of http://stackoverflow.com/questions/8098515/can-access-token-be-longer-than-255-characters -> I'm expecting some people might have 255-length tokens, even if I have no idea if people use those or not.\r\nAnd as mentioned in the StackOverflow question, we shouldn't limit those to 255 anyway."}}
{"actor":{"display_login":"jdubois"}}