luckyframework / luckyframework/avram
Check migrations for reserved words
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
I just tried to rename a Bool column to `primary`, but postgres said it was a syntax error. It wasn't really a "syntax" error, but more just the fact that it's a reserved word (i.e. PRIMARY KEY). If we have a way to list out the reserved words, that could help a ton.
So instead of seeing the error
> Caused by: syntax error at or near "primary" (PQ::PQError)
we could see an error like
> Caused by: The word "primary" is a reserved word in postgres. Try using a different column name
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
The issue concerns migration renames and PostgreSQL error reporting, but names no repository files or tests. Trace the rename migration entry point and PostgreSQL error path first; done means reserved-word failures produce the requested actionable message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal, postgres
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100