tags:

views:

88

answers:

1

Does anybady know how to make case insensitive table with liquibase. I'm using the newest postgres. For example liquibase creates table in that way:

create table "Users" (
  "userId" integer unique not null,
  "userFirstName" varchar(50) not null,
  "userLastName" varchar(50) not null
);

but how to make liquibase to create table in that way:

create table Users (
  userId integer unique not null,
  userFirstName varchar(50) not null,
  userLastName varchar(50) not null
);

+1  A: 

You can always use the tag to specify the exact SQL you want executed if liquibase is not generating what you want.

The default postgres support uses quotes around table and column names all the time so there will not be problems with using reserved words as object names. You can override this by creating your own liquibase.database.core.PostgresDatabase subclass and having liquibase use your class instead. There is an escapeDatabaseObject(String) method that is passed in the original string and returns the quoted value. You would just need to override this method to return the original string untouched.

How you use your database depends on your version of liquibase. If you are using a snapshot of the upcoming 2.0 release (http://liquibase.org/ci/latest), you simply need to keep your class in a liquibase.database.ext package. If you are using 1.9, there should be a databaseClassName parameter you can use to tell liquibase about your class.

Nathan Voxland
I'm using liquibase 1.9 but this what you mentioned is enaugh for me. Thank you.
kospiotr