Logo
Explore Help
Sign In
tandem/numerus
2
0
Fork 0
You've already forked numerus
Code Issues 45 Pull Requests Packages Projects 1 Releases 1 Wiki Activity
numerus/deploy/country_code.sql

15 lines
304 B
MySQL
Raw Permalink Normal View History

Use a select for company’s country field At first we thought that a regular text field would do, because we were afraid that a dropdown would be worse from the point of view of user experience, but then we realized that we need the country code for VAT and phone validation, and we can not expect users to input that, of course. I had to add the first “i18n table” to the database with the name of all countries in both Catalan and Spanish and Catalan; English is the default. For now i think i do not need a view that would select the name based on the locale of the current request, because currently i do not plan on adding any other such table —the currency uses the code and the symbol, thus no need for localization. However, now i need the language tag from the locale in order to get the correct translation, and gotext does not give me any way to access the inner language. Thus the need for our Locale type.
2023-01-27 21:30:14 +01:00
-- Deploy numerus:country_code to pg
-- requires: schema_numerus
begin;
set search_path to numerus, public;
create domain country_code as text
check (value ~ '^[A-Z]{2}$');
comment on domain country_code is
'A correctly formated, but not necessarily valid, ISO 3166-1 alpha-2 country code';
commit;
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 74ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API