org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Migration V1__hoge.sql failed ------------------------------ SQL State : 42000 Error Code : 42000 Message : SQLステートメントに文法エラーがあります "CREATE TABLE ""HOGES"" ( ""HOGE_ID"" BIGINT NOT NULL AUTO_INCREMENT, ""NAME"" VARCHAR(255) NOT NULL, ""EMAIL"" VARCHAR(255) NOT NULL, ""URL"" VARCHAR(255) DEFAULT NULL, ""COMMENT"" TEXT DEFAULT NULL, ""CREATED_AT"" DATETIME DEFAULT NULL, ""UPDATED_AT"" DATETIME DEFAULT NULL, PRIMARY KEY (""HOGE_ID""), UNIQUE KEY ""INDEX_HOGES_ON_EMAIL"" (""EMAIL"") ) ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE[*]=UTF8_GENERAL_CI " Syntax error in SQL statement "CREATE TABLE ""HOGES"" ( ""HOGE_ID"" BIGINT NOT NULL AUTO_INCREMENT, ""NAME"" VARCHAR(255) NOT NULL, ""EMAIL"" VARCHAR(255) NOT NULL, ""URL"" VARCHAR(255) DEFAULT NULL, ""COMMENT"" TEXT DEFAULT NULL, ""CREATED_AT"" DATETIME DEFAULT NULL, ""UPDATED_AT"" DATETIME DEFAULT NULL, PRIMARY KEY (""HOGE_ID""), UNIQUE KEY ""INDEX_HOGES_ON_EMAIL"" (""EMAIL"") ) ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE[*]=UTF8_GENERAL_CI "; SQL statement: CREATE TABLE `hoges` ( `hoge_id` bigint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `url` varchar(255) DEFAULT NULL, `comment` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`hoge_id`), UNIQUE KEY `index_hoges_on_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci [42000-190] Location : db/migration/V1__hoge.sql (/Users/niwashun/Workspaces/hogemoge/target/dev/scala-2.11/classes/db/migration/V1__hoge.sql) Line : 1 Statement : CREATE TABLE `hoges` ( `hoge_id` bigint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `url` varchar(255) DEFAULT NULL, `comment` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`hoge_id`), UNIQUE KEY `index_hoges_on_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via qiita.com by Unknown author, 1 year ago
Migration V1__hoge.sql failed ------------------------------ SQL State : 42000 Error Code : 42000 Message : SQLステートメントエラー "CREATE TABLE ""HOGES"" ( ""HOGE_ID"" BIGINT NOT NULL AUTO_INCREMENT, ""NAME"" VARCHAR(255) NOT NULL
via Stack Overflow by Tom W
, 2 years ago
Migration V1__Tables.sql failed ------------------------------- SQL State : 22019 Error Code : 911 Message : ORA-00911: invalid character Location : db/migration/V1__Tables.sql (C:\Workspaces\luna_64\flyway-spike\target\classes\db\migration
via GitHub by benheilers
, 2 years ago
Migration V2__AddColumn.sql failed ---------------------------------- SQL State : 42P01 Error Code : 0 Message : ERROR: relation "test_table" does not exist Location : db/migration/V2__AddColumn.sql (/home/heilers/perforce/ben-linux/main
via Stack Overflow by Amey Jadiye
, 2 years ago
Error executing statement at line 1: insert into PERSON (ID, NAME) values (1, 'Axel')
via GitHub by gzanthony
, 1 year ago
Error executing statement at line 39: ALTER TABLE `s_account_settings` ADD CONSTRAINT `FK_s_account_settings_2` FOREIGN KEY (`defaultThemeId`) REFERENCES `s_account_theme` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
via GitHub by hohwille
, 2 years ago
Migration V9001_1__Delete_data.sql failed ----------------------------------------- SQL State : 42S02 Error Code : 42102 Message : Table "RESTAURANTTABLE" not found; SQL statement: DELETE FROM RESTAURANTTABLE [42102-190] Location : AllTests
org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Migration V1__hoge.sql failed ------------------------------ SQL State : 42000 Error Code : 42000 Message : SQLステートメントに文法エラーがあります "CREATE TABLE ""HOGES"" ( ""HOGE_ID"" BIGINT NOT NULL AUTO_INCREMENT, ""NAME"" VARCHAR(255) NOT NULL, ""EMAIL"" VARCHAR(255) NOT NULL, ""URL"" VARCHAR(255) DEFAULT NULL, ""COMMENT"" TEXT DEFAULT NULL, ""CREATED_AT"" DATETIME DEFAULT NULL, ""UPDATED_AT"" DATETIME DEFAULT NULL, PRIMARY KEY (""HOGE_ID""), UNIQUE KEY ""INDEX_HOGES_ON_EMAIL"" (""EMAIL"") ) ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE[*]=UTF8_GENERAL_CI " Syntax error in SQL statement "CREATE TABLE ""HOGES"" ( ""HOGE_ID"" BIGINT NOT NULL AUTO_INCREMENT, ""NAME"" VARCHAR(255) NOT NULL, ""EMAIL"" VARCHAR(255) NOT NULL, ""URL"" VARCHAR(255) DEFAULT NULL, ""COMMENT"" TEXT DEFAULT NULL, ""CREATED_AT"" DATETIME DEFAULT NULL, ""UPDATED_AT"" DATETIME DEFAULT NULL, PRIMARY KEY (""HOGE_ID""), UNIQUE KEY ""INDEX_HOGES_ON_EMAIL"" (""EMAIL"") ) ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE[*]=UTF8_GENERAL_CI "; SQL statement: CREATE TABLE `hoges` ( `hoge_id` bigint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `url` varchar(255) DEFAULT NULL, `comment` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`hoge_id`), UNIQUE KEY `index_hoges_on_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci [42000-190] Location : db/migration/V1__hoge.sql (/Users/niwashun/Workspaces/hogemoge/target/dev/scala-2.11/classes/db/migration/V1__hoge.sql) Line : 1 Statement : CREATE TABLE `hoges` ( `hoge_id` bigint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `url` varchar(255) DEFAULT NULL, `comment` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`hoge_id`), UNIQUE KEY `index_hoges_on_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:117)
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:71)
at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:284)
at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:282)
at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:282)
at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46)
at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207)
at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156)

Users with the same issue

3 times, 7 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.