Note to myself on UUID usage

Open
#403 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
postgresql, rails, ruby
Domain
databases

Research direction

No files, tests, or entry points are named. Review the proposed create_table pattern and the project's existing database migrations to determine whether UUID defaults should become a project convention; done would require an agreed scope and an identified place to apply it.

Written by the indexing model from the issue text.

Description

Found this neat way for setting id as uuid, and this seems like the only place where I can be sure to find it 😂

So when creating new tables, let's consider using uuids

create_table "table_name", id: :uuid, default: "gen_random_uuid()", force: :cascade do |t|
    t.uuid     "user_id"
    t.jsonb    "settings",       default: {}, null: false
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
  end
Dominant language
Ruby
Stars
51
Forks
42
Avg merge
1h 27m
Merged PRs (30d)
1

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.

More from testmycode/tmc-server

All issues in testmycode/tmc-server

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.