Cannot create table with flyway (MYSQL)

Viewed 58

I try do create a simple mysql database with Flyway migration, but it doesn't going well.

I have created my .sql it named as V1_0__init.sql and I've written some sql commands there:

CREATE TABLE User (

    id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
    created DATE NOT NULL,
    username varchar(15) NOT NULL,
    password varchar(15) NOT NULL,
    email varchar(40) NOT NULL,
    status boolean NOT NULL,
    unique(username)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

I think it should be fine, but I have two errors, one at the first line (CREATE TABLE) and another at the fourth line (created DATE NOT NULL).

The error message says: Invalid or Incomplete statement Expected one of the following: ALGORITHM DEFINER SQL VIEW (At the 'created DATE NOT NULL' line have a similar message, the only difference is this: Algoritm definer OR sql view)

I've tried to fix these but it didn't go well. Anyone could help me how to fix this?

Maybe did I miss something? Should I do something in application.properties?

0 Answers
Related