In the end of November 2017 Rails 5.2.0 beta was released. Apart from many great improvements and new features, Active Storage, Redis Cache Store, HTTP/2 Early Hints, CSP, Credentials and more, now we received new PostgreSQL features for Rails 5.2 beta.
There are two features of PostgreSQL we’d like to share with you:
- Add support for PostgreSQL operator classes to
add_indexThe operator classes identify database operators to be used by the index for the columns. You can assign the same operator to all columns, or not. It currently only supports PostgreSQL.
- Add ability to create PostgreSQL foreign keys without validation
Normally, PostgresSQL verifies that all rows in a table satisfy its foreign keys constraints. With this option, you can create these constraints without the overhead of checking if they are valid.