Giter Club home page Giter Club logo

Comments (3)

nvoxland avatar nvoxland commented on July 26, 2024

Is this an error with the hibernate extension? Or the general liquibase formatted sql support?

from liquibase-hibernate.

scm6079 avatar scm6079 commented on July 26, 2024

This issue is a general Liquibase SQL Changeset error.
In a Liquibase SQL change set, you must start with the comment "--liquibase formatted sql". Unfortunately, this is not a well-formed comment in MySQL. The comment must be "-- liquibase formatted sql". If you add the space to the liquibase comment, liquibase does not recognize it. If you continue without the space, all MySQL lint programs (e.g. Intelli-J, etc.) mark those lines as errors, and the scripts can not be executed with MySQL Workbench or other MySQL tools.

For example:

--liquibase formatted sql
--changeset smoore:20140730 dbms:mysql failOnError:true
CREATE TABLE example
(
    company_guid varchar(36) not null,
    anything varchar(80),
    create_ts datetime not null default now(),
    lastmod_ts datetime not null default now(),
    primary key( company_guid )
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--rollback DROP TABLE example;

Performing a syntax check (or execution) against MySQL returns:

13:55:22 --liquibase formatted sql
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--liquibase formatted sql' at line 1.

The fix would be to allow liquibase to recognize a space after the "--" in the comment. This is not related to liquibase-hibernate specifically at all.

from liquibase-hibernate.

scm6079 avatar scm6079 commented on July 26, 2024

This was addressed by CORE-1032.
https://liquibase.jira.com/browse/CORE-1032

from liquibase-hibernate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.