-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path007-cldr-bcp-47-extensions.sql
47 lines (40 loc) · 1.36 KB
/
007-cldr-bcp-47-extensions.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
CREATE TABLE subtag_ext_key_value_type (
value_type text NOT NULL PRIMARY KEY
);
INSERT INTO subtag_ext_key_value_type
(value_type)
VALUES
('single'),
('multiple'),
('incremental'),
('any');
-- ---------------------------------------------------------------------------
CREATE TABLE subtag_ext_key (
ext_id text NOT NULL REFERENCES subtag_ext (id),
id text NOT NULL,
description text NULL,
deprecated boolean NOT NULL DEFAULT false,
preferred text NULL,
alias text NULL,
value_type text NULL REFERENCES subtag_ext_key_value_type (value_type),
PRIMARY KEY (ext_id, id)
);
-- ---------------------------------------------------------------------------
CREATE TABLE subtag_ext_key_type (
ext_id text NOT NULL,
key_id text NOT NULL,
id text NOT NULL,
description text NULL,
deprecated boolean NOT NULL DEFAULT false,
preferred text NULL,
alias text NULL,
PRIMARY KEY (ext_id, key_id, id),
FOREIGN KEY (ext_id, key_id) REFERENCES subtag_ext_key (ext_id, id)
);
-- ---------------------------------------------------------------------------
CREATE TABLE subtag_ext_attr (
id text NOT NULL PRIMARY KEY,
description text NOT NULL,
deprecated boolean NOT NULL DEFAULT false,
preferred text NULL
);