• 0 Posts
  • 5 Comments
Joined 2 years ago
cake
Cake day: June 22nd, 2023

help-circle

  • Heya, long time dev here.

    If you’re not expecting millions of rows, you could just use the country code directly in the user table and not use a foreign key/table at all. Just an idea.

    However, if you want the country table, i would find this list in a csv format (or copy paste into goog sheets or such and massage it) and then use a tool or write a quick script to ingest it into the db. If you’re doing that you should design the country table to have id, code, name. It can be used for populating dropdowns or autocomplete or such too.

    Over-engineering is a thing; keep it simple. If you’re doing this mainly as an exercise to learn, over-engineering can be ok - just understand that it doesn’t HAVE to be done any particular way, and there is no “right” way. Design is subjective and varies based on the needs of your software.