luckyframework / luckyframework/avram

Add multi-column index support for `add_index`

Open
#75 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

clarify api
Dominant language
Crystal
Stars
183
Forks
67
PR merge metrics
No merged PRs in 30d

Description

While it looks like `Avram::Migrator::CreateIndexStatement` supports multi-column indices, it doesn't appear that `Avram::Migrator::IndexStatementHelpers#add_index` supports it. The change seems like a pretty easy one. Just need to change
```crystal
def add_index(column : Symbol, unique = false, using : Symbol = :btree)
```
to
```crystal
def add_index(columns : Columns, unique = false, using : Symbol = :btree)
```
and resolve other references that might need to change (and add tests).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Avram::Migrator::IndexStatementHelpers#add_index and compare it with Avram::Migrator::CreateIndexStatement, which already appears to support multi-column indices. Trace other references to add_index, update the related signatures as needed, and add tests showing that multi-column indices work; the task is done when those tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal, postgresql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.