luckyframework / luckyframework/avram
Add multi-column index support for `add_index`
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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