H2 Database - Unknown MySQL script data type

I am new to using in-memmory database.

I tried using the H2 database to develop a project loading spring, spring JPA data, but I had a problem initializing the application.

Called: org.h2.jdbc.JdbcSQLException: Unknown data type: "FK_PERSON__PERSONTYPE_IDX"; SQL statement:

Because this script has been exported from MySQL. So I thought that there is a wrong syntax that H2 does not understand

For example, this is part of a script:

CREATE TABLE `person` ( `id` int(11) NOT NULL AUTO_INCREMENT, `firstname` varchar(255) NOT NULL, `lastname` varchar(255) DEFAULT NULL, `type` int(11) NOT NULL, `address` text, PRIMARY KEY (`id`), KEY `fk_person__persontype_idx` (`type`), CONSTRAINT `fk_person__persontype` FOREIGN KEY (`type`) REFERENCES `persontype` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' '; 

And I tried some of them:

Convert MySQL script to H2

http://matthewcasperson.blogspot.de/2013/07/exporting-from-mysql-to-h2.html

Replace characters with double quotes, single quotes, ... don't even use a quote at all, but don't work. Please show me why? Thanks.

+5
source share

Source: https://habr.com/ru/post/1237031/


All Articles