{"action":"created","issue":{"url":"https://api.github.com/repos/h2database/h2database/issues/1278","repository_url":"https://api.github.com/repos/h2database/h2database","labels_url":"https://api.github.com/repos/h2database/h2database/issues/1278/labels{/name}","comments_url":"https://api.github.com/repos/h2database/h2database/issues/1278/comments","events_url":"https://api.github.com/repos/h2database/h2database/issues/1278/events","html_url":"https://github.com/h2database/h2database/issues/1278","id":339768309,"node_id":"MDU6SXNzdWUzMzk3NjgzMDk=","number":1278,"title":"Fail to drop unique constraint created when the table was created","user":{"login":"Joaoc107","id":20255284,"node_id":"MDQ6VXNlcjIwMjU1Mjg0","avatar_url":"https://avatars1.githubusercontent.com/u/20255284?v=4","gravatar_id":"","url":"https://api.github.com/users/Joaoc107","html_url":"https://github.com/Joaoc107","followers_url":"https://api.github.com/users/Joaoc107/followers","following_url":"https://api.github.com/users/Joaoc107/following{/other_user}","gists_url":"https://api.github.com/users/Joaoc107/gists{/gist_id}","starred_url":"https://api.github.com/users/Joaoc107/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joaoc107/subscriptions","organizations_url":"https://api.github.com/users/Joaoc107/orgs","repos_url":"https://api.github.com/users/Joaoc107/repos","events_url":"https://api.github.com/users/Joaoc107/events{/privacy}","received_events_url":"https://api.github.com/users/Joaoc107/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T09:43:53Z","updated_at":"2018-07-10T10:35:35Z","closed_at":"2018-07-10T10:35:35Z","author_association":"NONE","body":"The external_id constraint is created at creation table time:\r\n\r\n`CREATE TABLE tests.event (\r\n  id VARCHAR(36),\r\n  external_id VARCHAR(40) NOT NULL UNIQUE\r\n);`\r\n\r\n`ALTER TABLE tests.event DROP INDEX external_id;`\r\n\r\n\r\n`SQL State  : 90057\r\nError Code : 90057\r\nMessage    : Constraint \"RAMP_ID\" not found; SQL statement:\r\nALTER TABLEtests.event DROP INDEX ramp_id [90057-197]\r\nLocation   : db/migration/V9__Alter_Constraints.sql (/Users/joaocesar/work/events/application/target/classes/db/migration/V9__Alter_Constraints.sql)\r\nLine       : 16\r\nStatement  : ALTER TABLE  tests.event DROP INDEX external_id`\r\n\r\n\r\nAfter I inspected both mysql db and the h2 db I found the problem. I checked information_schema.TABLE_CONSTRAINTS and h2 db is creating the constraint as constraint as CONSTRAINT_3 and on a standard mysql db is create as event_id.\r\n\r\nThis happens when the constraint is created without a proper name.\r\n\r\nI cannot change the creation table scripts, I'm using flyway for schema evolution and it prevents that."},"comment":{"url":"https://api.github.com/repos/h2database/h2database/issues/comments/403778021","html_url":"https://github.com/h2database/h2database/issues/1278#issuecomment-403778021","issue_url":"https://api.github.com/repos/h2database/h2database/issues/1278","id":403778021,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzc3ODAyMQ==","user":{"login":"grandinj","id":796121,"node_id":"MDQ6VXNlcjc5NjEyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/796121?v=4","gravatar_id":"","url":"https://api.github.com/users/grandinj","html_url":"https://github.com/grandinj","followers_url":"https://api.github.com/users/grandinj/followers","following_url":"https://api.github.com/users/grandinj/following{/other_user}","gists_url":"https://api.github.com/users/grandinj/gists{/gist_id}","starred_url":"https://api.github.com/users/grandinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grandinj/subscriptions","organizations_url":"https://api.github.com/users/grandinj/orgs","repos_url":"https://api.github.com/users/grandinj/repos","events_url":"https://api.github.com/users/grandinj/events{/privacy}","received_events_url":"https://api.github.com/users/grandinj/received_events","type":"User","site_admin":false},"created_at":"2018-07-10T10:35:35Z","updated_at":"2018-07-10T10:35:35Z","author_association":"CONTRIBUTOR","body":"Yeah, I'm sorry, but we're just not going to support that degree of MySQL compatibility. You'll have to use flyway in h2 mode or find some other solution"}}
{"actor":{"display_login":"grandinj"}}