xataio / pgroll

PostgreSQL zero-downtime migrations made easy
https://www.xata.io
Apache License 2.0
3.56k stars 67 forks source link

Support for partial indexes #322

Closed asomethings closed 2 weeks ago

asomethings commented 7 months ago

Our team tried to use pgroll for our new project and found out that it doesn't seem to have a partial index support.

It seems there were mentions while adding support for indexes (#49) but seems like it is not still implemented.

Since our new project highly depends on partial index, we're wondering if there is any plan for adding this feature.

exekias commented 7 months ago

Thank you for opening this! Support for partial indexes is indeed still pending. For now the alternative would be to use the sql migration to create them on your own, ie:

{
  "sql": {
    "up": "CREATE INDEX access_log_client_ip_ix ON access_log (client_ip)
           WHERE NOT (client_ip > inet '192.168.100.0' AND
           client_ip < inet '192.168.100.255')"
}