diff --git a/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java b/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java index cebfb46..fbcec3f 100644 --- a/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java +++ b/converter/src/test/java/com/granveaud/mysql2h2converter/converter/ConverterTest.java @@ -136,6 +136,11 @@ public void testScript5() throws Exception { loadScript("xwiki-sqlyog.sql"); } + @Test + public void testScriptCreateTableWithKey() throws Exception { + loadScript("create-table-with-key.sql"); + } + private void loadScript(String s) throws Exception { long time0 = System.currentTimeMillis(); diff --git a/converter/src/test/resources/scripts/create-table-with-key.sql b/converter/src/test/resources/scripts/create-table-with-key.sql new file mode 100644 index 0000000..521728c --- /dev/null +++ b/converter/src/test/resources/scripts/create-table-with-key.sql @@ -0,0 +1,10 @@ + +CREATE TABLE `sample` ( + `ID` bigint(20) NOT NULL AUTO_INCREMENT, + `VALUE` text, + `TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `version` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`), + UNIQUE KEY `PK_SAMPLE` (`ID`), + KEY `TIME` (`TIME`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='A sample table.';