liquibase 1.7

View: New views
2 Messages — Rating Filter:   Alert me  

liquibase 1.7

by miao wang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,
   I am trying to use liquibase 1.7 to generateChangeLog from MySQL  
and Oracle database.
   I got two problems so far:

   1.  In the generated changeLog for MySQL, I got a changeSet:

<column autoIncrement="true" name="ID_" type="bigint">
                 <constraints nullable="false" primaryKey="true"  
primaryKeyName="PRIMARY"/>
             </column>
   And later, when I tried to migrate a new database based on this  
changeLog, it failed. The error was given as:

   Caused by: java.sql.SQLException: 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 'PRIMARY KEY (`ID_`))' at line 1

   I think the problem was because of the last line in the SQL:
SQL CREATE TABLE `JBPM_ACTION` (`ID_` bigint AUTO_INCREMENT  NOT NULL,  
(..........) CONSTRAINT PRIMARY PRIMARY KEY (`ID_`))

   2.  I found that the table indexes were missing in the generated  
changeLog for both MySQL and Oracle databases.

   I wonder if anybody had similar problem or have solution for it?
   Cheers,
Miao


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Liquibase-devel mailing list
Liquibase-devel@...
https://lists.sourceforge.net/lists/listinfo/liquibase-devel

Re: liquibase 1.7

by Alexandr Popov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 09 July 2008 14:41:17 miao wang wrote:

> Hi guys,
>    I am trying to use liquibase 1.7 to generateChangeLog from MySQL
> and Oracle database.
>    I got two problems so far:
>
>    1.  In the generated changeLog for MySQL, I got a changeSet:
>
> <column autoIncrement="true" name="ID_" type="bigint">
>                  <constraints nullable="false" primaryKey="true"
> primaryKeyName="PRIMARY"/>
>              </column>

First of all primary key name is using reserved word "PRIMARY". Try to change it to
another if possible.

>    And later, when I tried to migrate a new database based on this
> changeLog, it failed. The error was given as:
>
>    Caused by: java.sql.SQLException: 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 'PRIMARY KEY (`ID_`))' at line 1
>
>    I think the problem was because of the last line in the SQL:
> SQL CREATE TABLE `JBPM_ACTION` (`ID_` bigint AUTO_INCREMENT  NOT NULL,
> (..........) CONSTRAINT PRIMARY PRIMARY KEY (`ID_`))
>

Second problem reserved word is not correctly escaped "CONSTRAINT PRIMARY PRIMARY KEY ".

>    2.  I found that the table indexes were missing in the generated
> changeLog for both MySQL and Oracle databases.
>
>    I wonder if anybody had similar problem or have solution for it?

Solution for this will be renaming primaryKeyName or changing code of liqiubase to suport
escaping of reserved words for mysql.

This issue related to all DB. While FK built it does not escape reserved words in
constraint names.


--

Alexandr Popov

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Liquibase-devel mailing list
Liquibase-devel@...
https://lists.sourceforge.net/lists/listinfo/liquibase-devel