JakenVeina

joined 3 days ago
[–] JakenVeina@midwest.social 12 points 12 hours ago

Also, I was born there, and I hate it.

[–] JakenVeina@midwest.social 7 points 13 hours ago (1 children)

Not one single mention for Gone in Sixty Seconds?

Lemmings... do I have bad taste?

[–] JakenVeina@midwest.social 1 points 1 day ago

That's a perfectly valid approach, yes. We do exactly this, at work. It's pretty common, if not ubiquitous, to have your database schema consist of not only structure, but data as well. We call it static data, and it's all defined in deployable scripts, just like our tables and views are. If ISO makes changes to the dataset, then it's just a table update to match it. And ISO is nice about keeping backwards compatibility inb their standards.

Since this is not strictly your own data, you could also go with just storing the code value on your tables, and letting the UI layer do the lookup, either with built-in features of your language/framework, or with a static csv file, like you mention. You may not want to do this for static data that is entirely your own, like, say, a status or type enum, since it makes your database schema less-self-descriptive, and more prone to becoming invalid.

You could also set the country code up as a not-strictly-enforced foreign key, where your app will lookup additional info (E.G. the proper name) for a country code, if it's a standard one, but just skip that if it's not a standard one.

It's up to you what you think is most appropriate.