title: ERROR: syntax error in or near "CREATE" in sql script for PostgreSQL
body: <p>I want to use the SQL script that I generated to create tables for entities. I use Flyway for this. There is a problem during compilation</p>
  
  <pre><code>2018-03-22 19:03:23.590 ERROR 3784 --- [ost-startStop-1] o.f.core.internal.command.DbMigrate      : Migration of schema "public" to version 1 - Base Version failed! Changes successfully rolled back.
  2018-03-22 19:03:23.597 ERROR 3784 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in file [C:\Users\Jonatan\Documents\GitHub\REST-Web-Services\web\out\production\classes\com\web\web\security\service\impl\UserDetailsServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#3f3908cf' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#3f3908cf': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException: 
  Migration V1__Base_Version.sql failed
  -------------------------------------
  SQL State  : 42601
  Error Code : 0
  Message    : ERROR: syntax error in or near "CREATE"
    Position: 355
  Location   : db/migration/postgresql/V1__Base_Version.sql (C:\Users\Jonatan\Documents\GitHub\REST-Web-Services\web\out\production\resources\db\migration\postgresql\V1__Base_Version.sql)
  Line       : 9
  Statement  : CREATE TABLE contributions (ID BIGINT NOT NULL, created TIMESTAMP NOT NULL, entity_version INTEGER NOT NULL, field VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, user_comment VARCHAR(255), verification_comment VARCHAR(255), verification_date TIMESTAMP, movie_id BIGINT NOT NULL, user_id BIGINT NOT NULL, verification_user BIGINT, PRIMARY KEY (ID))
  CREATE TABLE messages (id  SERIAL NOT NULL, created TIMESTAMP NOT NULL, date_of_read TIMESTAMP, entity_version INTEGER NOT NULL, visible_for_recipient BOOLEAN NOT NULL, visible_for_sender BOOLEAN NOT NULL, subject VARCHAR(255) NOT NULL, text VARCHAR(4000) NOT NULL, unique_id VARCHAR(255) NOT NULL UNIQUE, recipient_id BIGINT NOT NULL, sender_id BIGINT NOT NULL, PRIMARY KEY (id))
  CREATE TABLE movies_ratings (id  SERIAL NOT NULL, DATE TIMESTAMP NOT NULL, rate INTEGER NOT NULL, movie_id BIGINT NOT NULL, user_id BIGINT NOT NULL, PRIMARY KEY (id))
  CREATE ...
  CREATE ...
  CREATE ...
  ...
  </code></pre>
  
  <p>The whole script here <a href="https://pastebin.com/8G3js0Pz" rel="nofollow noreferrer">https://pastebin.com/8G3js0Pz</a>.</p>
  
  <p>I do not know why the word "CREATE" recognizes as a syntax error.</p>