1

I want to create an index in alembic which will be similar to this:

CREATE INDEX my_index ON tab(columnA DESC, columnB COLLATE "da_DK" ASC, id DESC);

I know that I can do something like:

 op.create_index('my_index', 'tab', ['columnA', 'columnB'])

but I don't know how I can pass collate option.

Mariusz
  • 349
  • 2
  • 7

1 Answers1

1

Ok. The solution was using:

op.create_index('my_index', 'tab', ['columnA', text('columnB COLLATE "da_DK" ASC')])
Mariusz
  • 349
  • 2
  • 7