sqlalchemy-bot · GitHub

Migrated issue, originally created by roy enjoy (@kirpit)

The following operation is failing and postgresql complains about its syntax.

op.create_index('ix_publish_at', 'cms_video', [sa.text(u'cms_video.publish_at DESC')], unique=False)

sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) syntax error at or near "DESC" LINE 1: ...INDEX ix_publish_at ON cms_video (cms_video.publish_at DESC)

publish_at is a simply DateTime field and here is the index definition:
Index('ix_publish_at', publish_at.desc())

I created the revision file with --autogenerate.

I found an exact same question but it seems he had old version of psql running. My postgresql was installed with brew and its version is 9.4.4 that should be enough to support desc indexes. Tried with alembic==0.8.3, I don't know what is wrong.

Read the original on github.com ↗