我有一个带有几何列的 Postgres + PostGIS 数据库。
我想为它们添加索引,例如
create index plot_idx_location on plot using gist (location);
我知道如何使用 sqlt_deploy_hook 方法在 DBIx::Class 中创建索引,但我不确定 add_index 生成上述语句的语法是什么。
阅读 SQL::Translator 文档(http://search.cpan.org/~frew/SQL-Translator-0.11016/lib/SQL/Translator/Schema/Index.pm)似乎没有帮助。没有使用“选项”参数的示例,并且简要查看源代码,我怀疑它甚至不被支持。
那么有没有办法做到这一点,还是我需要在 sqlt_deploy_hook 方法中硬编码 SQL 语句?