cockroachdb / cockroachdb/activerecord-cockroachdb-adapter

Currently no support for indexes that utilize `STORING`

Abierto
#282 0 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Ruby
Estrellas
105
Forks
56
Merge medio
9 h 5 min
PR fusionados (30 d)
3

Descripción

Currently it is only possible to specify the columns that need to be stored in an index using the regular [`add_index`](https://api.rubyonrails.org/v7.0.6/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_index) method. We therefore resort to [`execute`](https://api.rubyonrails.org/v7.0.6/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#method-i-execute) statements like the following:

```
CREATE INDEX "users_lastname_asc"
ON users (last_name ASC)
STORING (first_name, company_id);
```

This will however add an index declaration to the `schema.rb` that reads as follow:

```
t.index ["last_name", "first_name", "company_id"], name: "users_lastname_asc"
```

This seems like an implementation detail leaking into the `schema.rb`: Obviously the stored columns are part of the index, but to the best of my understanding they are not contributing to the lookup data structures. So the `schema.rb` is now expressing something different than the actual migration.

tl;dr: Please ...
- [ ] Support `STORING` in `add_index`
- [ ] Support indices created using `STORING` in `schema.rb`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.