Collation support?

Not directly. You either need to use the tag, or the tag to add it yourself.


You can also create an extension (liquibase.org/extensions) to build in support more directly.


Nathan

Hi!
I use MySQL I would like to define the column collation (sorting). Is there any support using Liquibase?
Cheers,
Christopher

Hi!

I am also facing effects of missing support for collation. Having a chance to define custom collation at column element would be helpful. I mean, if there can be support for encoding attribute (which apparently does nothing on MS SQL), one extra attribute for collation would surely not harm anything.

Currently when someone needs to define a custom collation, not neccessarily for the purpose of ordering but also for controlling case sensitivity or accent sensitivity (my situation), then the user is basically left in dark with poor options. If there was at least allowed at column level but unfortunatelly it’s not.

Sure, raw works somehow but it’s cumbersome and not really right tool for collation adjustment. MS SQL example:

      ALTER TABLE [table] ALTER COLUMN column1 varchar COLLATE ${collation.insensitive} NOT NULL

See? Technically there doesn’t seem a way to change collation alone without having to manipulate (redefine!) column type and constraint. I have no desire to define column type constraint twice in the changelog (once in proper table definition and second in sql). That’s would be plain bad practise.

Has anyone managed to deal with collation definition in Liquibase changeset in a sensible manner? At this point I am inclined to give up, which would be a pitty.

Tomas

There is still nothing built in, although it would be possible to write an extension to support it. Since collation tends to be database-specific I probably won’t put it in the main library, but the liquibase-mssql extension would be a good place for it.

For now, I’d suggest using on the original table definition to insert in the collation clause as needed.

Nathan