在 Rails 中,如何在迁移到具有特定排序顺序的 Postgres 数据库中添加索引?
最终想要完成这个查询:
CREATE INDEX index_apps_kind_release_date_rating ON apps(kind, itunes_release_date DESC, rating_count DESC);
但是现在在我的迁移中,我有这个:
add_index :apps, [:kind, 'itunes_release_date desc', 'rating_count desc'], name: 'index_apps_kind_release_date_rating'
吐出这个:
CREATE INDEX "index_apps_kind_release_date_rating" ON "apps" ("kind", "itunes_release_date desc", "rating_count desc")
哪些错误:
PG::Error: ERROR: column "itunes_release_date desc" does not exist