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

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web33

  • via qiita.com by Unknown author, 9 months 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 GitHub by ghaseminya
    , 6 months ago
    Migration V19__ADD_INBOUND_MAIL.sql failed ------------------------------------------ SQL State : 42000 Error Code : 1067 Message : Invalid default value for 'MAIL_CONFIG_LAST_CHECKED' Location : io/lavagna/db/MYSQL/V19__ADD_INBOUND_MAIL.sql
  • (/Users/nv/jdbc/sjs/file:/Users/nv/jdbc/sjs/spark-job-server.jar!/db/h2/migration/V0_7_0__init_tables.sql) Line : 1 Statement : CREATE TABLE JARS ( JAR_ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY, APP_NAME VARCHAR(255) NOT NULL, UPLOAD_TIME TIMESTAMP NOT NULL, JAR BYTEA NOT NULL )
  • Stack trace

    • 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
    • iwashun/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) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    3 times, 1 month ago