luckyframework / luckyframework/avram

Check migrations for reserved words

Open
#739 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

improve error experience
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.