luckyframework / luckyframework/website

Documenting tables with no primary keys

Open
#499 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

guides:update
Dominant language
Crystal
Stars
39
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Ref: https://github.com/luckyframework/avram/pull/549#pullrequestreview-543134475
Ref: https://github.com/luckyframework/avram/issues/6

TL;DR: Lucky won't really support tables with no primary key at all, so we need to document how to best get your table setup if it doesn't currently have a primary key.

Basically this would be documenting how to generate a migration that alters your table, adds in a nilable id column, fills it with some data, then makes it not nilable and set the default to some autoincrementing field. I've never tried it, but can you just tell postgres "here's a new primary key field", and it all just works? 🤔

Contributor guide

No contributing guide indexed for this repository

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 the referenced Avram pull request and issue to understand the existing guidance for tables without primary keys. Verify the PostgreSQL migration approach for adding and populating a nullable id before making it non-null with an autoincrementing default. Done means the website documents a reliable setup path and its limitations.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.